1

I'm using the react-idle-timer library to prompt users on idle. This is how I have integrated it.

  const eventsTimer = useIdleTimer({
    element: document,
    startOnMount: false,
    startManually: true,
    name: "events-timer",
    onAction: createPageEvent,
    events: ["click", "mousemove", "keydown", "touchstart", "change", "select", "scroll"],
  });

  // USER ACTIVITY TIMER
  const activityTimer = useIdleTimer({
    crossTab: true,
    syncTimers: 200,
    startOnMount: false,
    startManually: true,
    name: "activity-timer",
    timeout: expireTestTime * 60 * 1000, // in miliseconds
    onIdle: () => sendMsgToBackground({ action: ACTION.USER_ACTIVITY_IDLE }),
  });

It was working fine earlier but recently when I did the npm i to install the required libraries, it stopped working. Now I'm getting the error like The value for the promptBeforeIdle property must be less than the timeout property idletimer.

I'm not using the promptBeforeIdle property but still I'm getting this error. Is there any solution for this?

Tikam Chand
  • 94
  • 1
  • 10
  • Just faced a similar issue. promptBeforeIdle is 0 by default. So check to confirm that your timeout is never 0 at any point. promptBeforeIdle must always be less than timeout – tony baidoo Jun 06 '23 at 15:58
  • First of all, I'm not even using both of these properties. Second, I have also tried doing that but still it gives me the same message. By the way, I was working perfectly fine in v5.4.2. This issue is only occurring in the latest version. – Tikam Chand Jun 07 '23 at 06:32

0 Answers0