Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Preact SnippetsNew to Visual Studio Code? Get it now.
Preact Snippets

Preact Snippets

Praveen S

|
404 installs
| (0) | Free
Snippets for Preact
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Import Snippets

Preact Functional Component

  • Prefix: pfc
  • Description: Creates a functional component template.

Preact Class Component

  • Prefix: pcc
  • Description: Creates a class component template.

Easily import hooks and other utilities from Preact with the following snippets:

Prefix Import Statement Description
imstate import { useState } from 'preact/hooks'; Import useState from Preact
imref import { useRef } from 'preact/hooks'; Import useRef from Preact
imeffect import { useEffect } from 'preact/hooks'; Import useEffect from Preact
imcontext import { useContext } from 'preact/hooks'; Import useContext from Preact
imreducer import { useReducer } from 'preact/hooks'; Import useReducer from Preact
imcallback import { useCallback } from 'preact/hooks'; Import useCallback from Preact
immemo import { useMemo } from 'preact/hooks'; Import useMemo from Preact

Contributing

Feel free to open issues or PRs if you have suggestions or improvements!

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft