README.md
October 4, 2025 · View on GitHub
React Snippet (Visual Studio Code)

Design Notes
Due to the React Hooks 'Functional Programming' paradigm, there is not much structural code. Especially with the React Compiler, you no longer need to manually reach for useMemo, useCallback, or React.memo, so there is very little template code remaining.
Therefore, this snippet extension only includes the following three parts:
- Functional components
- Common Hooks
- Common APIs
Snippets
(1). Functional Components
fc - React Functional Component (TypeScript)
export interface FeatureProps {
}
export default function Feature(props: FeatureProps) {
return (
);
}
rfc - React Functional Component (TypeScript)
interface FeatureProps {
}
function Feature(props: FeatureProps) {
return (
);
}
fc - React Functional Component
export default function Feature(props) {
return (
);
}
rfc - React Functional Component
function Feature(props) {
return (
);
}
- Functional Component
- React API
<Activity><Profiler><Suspense>
(2). Hooks
useCallback - useCallback >>
const handler = useCallback((param) => {}, [dependencies]);
- State Hooks
useStateuseReducer
- Context Hook
useContext
- Ref Hooks
useRefuseImperativeHandle
- Effect Hooks
useEffectuseLayoutEffectuseInsertionEffectuseEffectEvent
- Performance Hooks
useMemouseCallbackuseTransitionuseDeferredValue
- Other Hooks
useActionStateuseSyncExternalStoreuseOptimistic
- Form Hooks
useFormStatus
(3). APIs
memo >>
import { memo } from 'react';
export interface FeatureProps {
}
const Feature = memo(function Feature(props: FeatureProps) {
return (
);
});
export default Feature;
- React API
lazymemocreateContextstartTransition
- React DOM API
createPortal
- Client React DOM API
createRoot
Related Snippets
If you need react-router, please install React Router Snippets.
If you need zustand + immer, please install Zustand + Immer Snippets.
License
MIT License