Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(useDidUpdate): useDidUpdate to make it work with Strict Effects (#…
…974) * Add cleanup to make it work with Strict Effects > With the release of React 18, StrictMode gets an additional behavior to ensure it's compatible with reusable state. When StrictMode is enabled, **React intentionally double-invokes effects (mount -> unmount -> mount) for newly mounted components**. [Source](reactwg/react-18#19) So, it's essential that the `hasMountedRef` is reset when unmounting otherwise it won't behave desirably when wrapped inside StrictMode. * Update useDidUpdate.ts
- Loading branch information