A set of supplementary React hooks
npm install react-use-morebash
npm install react-use-more
`
Hooks
$3
Provides a function that forces the component it was created in to re-render when called. This is only intended as a last resort and should be avoided in favor of restructuring your component state.$3
This hook tracks the value most recently passed in, making it instantly available as a ref. It has the most up-to-date value when accessed through a stale callback.$3
This hook retains the same value for the entire lifetime of a component. It's initialized by calling the factory function provided to it on first render, and the factory function is never called again. This hook is intended to act like members in class components.$3
This hook functions identically to useMember, but returns a ref. This allows the value to be fully replaced any time after initialization.$3
This hook returns a function that can be called anywhere and anytime to determine if the component is currently mounted. This is useful when working with asynchronous code or when needing to know the mounted state of the component outside of the render cycle. The function returned by useMounted will always have the same identity, so it can be safely passed as a dependency to other hooks or functions without causing unnecessary re-renders.$3
This hook allows you to register a cleanup function that will be called when a component unmounts. It ensures that the function passed to it is the most recent one, as opposed to just returning a cleanup function from useEffect with an empty dependency list (useEffect(() => cleanup, [])`), which would call the function passed to it on mount, which could be out-of-date.