Skip to content

fyangstudio/react-hooks-snippets

 
 

Repository files navigation

React Hooks Snippets icon



React Hooks Snippets is a Visual Studio Code extension to make writing ReactJS Hooks easier and faster!

Features

The current supported snippets are: useState, useEffect, useContext, useCallback, useMemo, useRef, useReducer, useSelector, useDispatchFunction, useDispatch, as well as snippets for import react hooks and import react redux hooks.

useState

Type ush to use state hook!

useEffect

Type ueh to use effect hook!

useContext

Type uch to use context hook!

useCallback

Type ucbh to use call back hook!

useMemo

Type umh to use memo hook!

... More have been added! See below

useRef

Type urh to use ref hook

useReducer

Type urdh to use reducer hook

useSelector

Type uss to u``se selector hook

useDispatchFunction

Type usdf to u``se dispatch function hook

useDispatch

Type usd to u``se dispatch hook

import React hooks

Type irh to import React and the most commonly used hooks

import React Redux hooks

Type irrh to import react redux hooks

prev state

Type prev to use previous state

Add to your project

There are 2 ways you can add React Hooks Snippets to your project:

By command

Launch VS Code Quick Open (Ctrl+P), paste the ext install AlDuncanson.react-hooks-snippets, and press enter.

By the Extension Marketplace

Launch VS Code Extension Marketplace (Ctrl+Shift+X), search for React Hooks Snippets, and look for my logo!

Todo

  • add useReducer hook
  • add useCallback hook
  • add useMemo hook
  • add useRef hook
  • add useImperativeHandle hook
  • add useLayoutEffect hook
  • add useDebugValue hook

Pull requests are more than welcomed!

License

Usage is provided under the MIT License. See LICENSE.txt for the full details.

Releases

No releases published

Packages

No packages published