Loading homepage
Implement a real React hook that manages boolean state and exposes convenient methods to enable, disable, toggle, or directly update it. Use the JavaScript or TypeScript variant and keep the interface identical.
Call this hook inside a React component. The supplied tests render React components and inspect the hook again after updates.
Input: useBoolean() Output: value is false on the first render.
Input: setTrue(); then rerender Output: value is true.
Input: toggle(); toggle() in one event Output: The value is unchanged after the two toggles.
Returns a live-on-rerender object with boolean state and four stable utility methods.