When running React 18+ in Strict mode during dev, the component will "mount, unmount, then remount again" in order to ensure components have reusable state (read more).
Because of this behaviour and the fact the isMounted ref is not set to reset in the component's useEffect, the flag is permanently set to false under certain circumstances. See the issue for more info.
What is the current behavior?
The isMounted ref is set to false immediately on mount because of the effect of strict mode.
What is the new behavior?
The isMounted ref is correctly reset back to true whenever the component is remounted or the authView changes.
What kind of change does this PR introduce?
Fixes #79.
When running React 18+ in Strict mode during dev, the component will "mount, unmount, then remount again" in order to ensure components have reusable state (read more).
Because of this behaviour and the fact the
isMounted
ref is not set to reset in the component'suseEffect
, the flag is permanently set to false under certain circumstances. See the issue for more info.What is the current behavior?
The
isMounted
ref is set to false immediately on mount because of the effect of strict mode.What is the new behavior?
The
isMounted
ref is correctly reset back to true whenever the component is remounted or theauthView
changes.