Collection of my own react snippets I use, supporting both JavaScript and TypeScript.
- 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
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 |
This project is licensed under the ISC License - see the LICENSE file for details.