Skip to content

antmdvs/vscode-react-hooks-snippets

Repository files navigation

React Hooks Snippets for Visual Studio Code

The React Hooks API is available beginning with React version 16.8. See https://reactjs.org/hooks for more information.

Features

This extension includes a handy snippet for the useState hook.

useState

*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)

Requirements

  • Visual Studio Code 1.25.1 or higher.
  • React 16.8.0 or higher.

"What about the other hooks?"

I'll be carefully evaluating the usefulness of snippets for the remaining hooks. Please use GitHub to file/upvote requests for other hooks.