mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-20 18:56:30 +00:00
useIsMountedRef set its ref in a passive effect, which React runs some time after the commit. In between, the component is in the DOM and can be clicked while the ref still says it is not mounted, and useToggle drops the click. The Accounts page showed it: an "Account" click right after the page drew did not open the create modal. Under load in a spec this happened in one run out of five. A layout effect runs during the commit, before an event can reach the component; unmounting still clears the ref.
@pezkuwi/react-hooks
WARNING: This is an internal package to pezkuwichain/pezkuwi-apps so is not intended (yet) for broad use. Since these are generic components, they will move to the pezkuwichain/pezkuwi-ui repo once deemed stable and usable.
For the existing sharable components usable in external React-based projects, take a look at the pezkuwichain/pezkuwi-ui documentation