An open API service indexing awesome lists of open source software.

https://github.com/alduncanson/react-hooks-snippets

Visual Studio Code extension, code snippets for React Hooks
https://github.com/alduncanson/react-hooks-snippets

hacktoberfest hooks javascript react snippets vscode

Last synced: about 2 months ago
JSON representation

Visual Studio Code extension, code snippets for React Hooks

Awesome Lists containing this project

README

        


React Hooks Snippets icon

# React Hooks Snippets

![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/AlDuncanson.react-hooks-snippets)
![Visual Studio Marketplace Rating](https://img.shields.io/visual-studio-marketplace/r/AlDuncanson.react-hooks-snippets)
![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/AlDuncanson.react-hooks-snippets)
![GitHub Repo stars](https://img.shields.io/github/stars/alDuncanson/react-hooks-snippets)
![GitHub forks](https://img.shields.io/github/forks/alDuncanson/react-hooks-snippets)

A [Visual Studio Code](https://code.visualstudio.com/) extension that adds snippet functionality for [React Hooks](https://react.dev/reference/react/hooks).

> Now updated to support all of the new hooks introduced in [React v19](https://react.dev/blog/2024/12/05/react-19)!

## Supported Hooks

### State Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `ush` | `useState` |
| `urdh` | `useReducer` |

### Context Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `uch` | `useContext` |

### Ref Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `urh` | `useRef` |
| `uihh` | `useImperativeHandle` |

### Effect Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `ueh` | `useEffect` |
| `uleh` | `useLayoutEffect` |
| `uieh` | `useInsertionEffect` |

### Performance Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `umh` | `useMemo` |
| `ucbh` | `useCallback` |
| `uth` | `useTransition` |
| `udvh` | `useDeferredValue` |

### React Dom Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `ufsh` | `useFormStatus` |

### Other Hooks
| Prefix | Snippet |
| ------------- | ------------- |
| `udbvh` | `useDebugValue` |
| `uidh` | `useId` |
| `usesh` | `useSyncExternalStore` |
| `uash` | `useActionState` |
| `uoh` | `useOptimistic` |

## Install

Add the React Hooks Snippets extension to VS Code using one of the following methods:

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

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

### By the Marketplace website
Visit the extension's [Visual Studio Marketplace page](https://marketplace.visualstudio.com/items?itemName=AlDuncanson.react-hooks-snippets) and click `Install`.

## License
Usage is provided under the [MIT License](https://opensource.org/licenses/MIT). See [LICENSE.txt](https://github.com/alDuncanson/react-hooks-snippets/blob/master/LICENSE.txt) for the full details.

## Support My Work

If you like this extension, please consider supporting me by buying me a coffee!

Buy Me A Coffee