SupremeTechnopriest / react-idle-timer

User activity timer component
https://idletimer.dev
MIT License
1.15k stars 143 forks source link

🐞 React 17 - Timer starting without timer.start() although startManually prop is true #386

Open rpc5255 opened 10 months ago

rpc5255 commented 10 months ago

What happened?

https://codesandbox.io/p/sandbox/gallant-worker-wwwyv2

The timer is starting when you move your mouse into the browser even though timer.start() was not called and startManually prop is true. timer.reset() was called in the mount. To fix, I can update my index.js to the React v18 default way. This is just sample code. In my current project, I cannot update to React v18.

Reproduction Steps

1. Use React v17
2. call timer.reset() in componentDidMount
3. move mouse inside browser
4. the timer will start running
...

Relevant log output

No response

Screenshots or Additional Context

No response

Module Version

5.7.2

What browsers are you seeing the problem on? Select all that apply.

No response

What devices are you seeing the problem on?

No response

Verification