Next.js Snippets
This extension adds snippets for Next.js and React
Supported languages (file extensions)
- JavaScript (.js)
- JavaScript React (.jsx)
- TypeScript (.ts)
- TypeScript React (.tsx)
React
Trigger |
Content |
impr |
import { } from 'react' |
ust |
Use useState |
uef |
Use useEffect |
ulayef |
Use useLayoutEffect |
ucb |
Use useCallback |
umem |
Use useMemo |
uref |
Use useRef |
uctx |
Use useContext |
cctx |
Create context with custom hook |
cc |
Class Component |
ccc |
Class Component with constructor |
fc |
Functional Component |
fcfr |
Functional Component with forwardRef |
Next.js
Trigger |
Content |
impn |
import { } from 'next' |
initp |
getInitialProps() |
sp |
getStaticProps() |
spth |
getStaticPaths() |
ssp |
getServerSideProps() |
np |
NextPage |
npsp |
NextPage with getStaticProps() |
npssp |
NextPage with getServerSideProps() |
npinitp |
NextPage with getInitialProps() |
hd |
Use Head |
lnk |
Use Link |
lnkdyn |
Use Link with dynmic route |
img |
Use sized Image component |
uimg |
Use unsized Image component |
| |