Skip to content

Praveen-webdev/preact-snippets

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published