Skip to content

Instantly share code, notes, and snippets.

@neolefty
Last active February 22, 2022 04:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neolefty/ce3e0b1f01f9032177d520a2d86b9e69 to your computer and use it in GitHub Desktop.
Save neolefty/ce3e0b1f01f9032177d520a2d86b9e69 to your computer and use it in GitHub Desktop.
const [
open, // current state: opened or closed?
toggle // HIDDEN DISPATCH
] = useReducer(
state => !state, // a reducer that, umm, ignores its action?
false // initial state: open = false
)
@neolefty
Copy link
Author

Credit @JLarky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment