Last active
February 22, 2022 04:19
-
-
Save neolefty/ce3e0b1f01f9032177d520a2d86b9e69 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Credit @JLarky.