react-activation icon indicating copy to clipboard operation
react-activation copied to clipboard

useActivate is being fired 3 times

Open husayt opened this issue 1 year ago • 2 comments

Hi, I have implemented keepalive for tab switching and get this weird behavior when switching between tabs I get useUnactivate fired once and useActivate fired three times for each tab.

What is the reason for that?

Thanks in advance

husayt avatar Mar 13 '23 11:03 husayt

Have you event been using <React.StrictMode />? StrictMode would trigger lifecycle many times which should not be used with react-activation

CJY0208 avatar Mar 15 '23 05:03 CJY0208

Thanks for reply. In dev mode as it is running in strictmode seems this is default behaviour. Is there way to disable strictmode for webpack devserver?

husayt avatar Mar 27 '23 10:03 husayt