The React Hooks API is available beginning with React version 16.8. See https://reactjs.org/hooks for more information.
This extension includes a handy snippet for the useState hook.
*The second placeholder value is automatically capitalized on Tab.
There are also a few variations for common initial state values:
Snippet | Purpose |
---|---|
us |
useState() |
usf |
useState(false) |
ust |
useState(true) |
usn |
useState(null) |
- Visual Studio Code 1.25.1 or higher.
- React 16.8.0 or higher.
I'll be carefully evaluating the usefulness of snippets for the remaining hooks. Please use GitHub to file/upvote requests for other hooks.