The React Hooks API is currently experimental. See https://reactjs.org/hooks for more information.
This extension contributes a handy snippet for the useState hook.
The second placeholder value is automatically capitalized on Tab.
In addition, there are a few variations with 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.
TBD. After all, Hooks are not officially released yet.
It's easy enough to create your own snippet in VS Code! You can use this gist as a starting point.