Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MichaelFarquhar/react-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

React Snippets

VS Code JavaScript TypeScript

Collection of react snippets I use, supporting both JavaScript and TypeScript. I use these over the many pre-existing extensions because those generally clog up VS Code with tons of snippets i would never use.

How To Add Snippets

  • Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  • Type "Configure User Snippets" and select it
  • Choose "New Global Snippets file..."
  • Name your snippets file whatever you'd like
  • Copy and paste the snippets into the newly created file

✂️ Snippets

Alias Purpose
imr Import React statement
rc React Function Component with export const
rct Same as above but with a props interface
ush useState Hook
efh useEffect Hook
ech useCallback Hook
emh useMemo Hook
urh useRef Hook
tern Ternary Operator Condition
ushLoad Generic loading state hook
uihh useImperativeHandle hook
utt useTranslation hook with t function

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Collection of react snippets that I use, supporting both JavaScript & TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /