Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.5 KB

README.md

File metadata and controls

53 lines (38 loc) · 1.5 KB

typescript-react-snippets README

This Snippet Pack contain a collection of snippets to work with various npm-packages for react, redux and testing-library

Redux:

Tests

React

Features

###snippet commands:

Test

  • describe (jest describe shortcut)
  • it (jest it shortcut)

Redux

  • redux-configurestore (boilerplate to create the RootState + RootReducer)
  • redux-create-slice (boilerplate to create a State + Reducer slice)
  • redux-create-reducer (add actions to redux-create-slice)
  • redux-create-async-thunk (create an async thunk)
  • redux-create-api (add an RTK Query reducer)
  • redux-api-endpoint (add an RTK Query or Mutation endpoint)
  • useDispatch (add useDispatch to React.FC)
  • useSelector (add useSelector to React.FC)
  • useStore (add useStore to React.FC)

React

  • rfc (React.FC skeleton)
  • useState (add useState to React.FC)
  • useCallback (add useCallback to React.FC)
  • useEffect (add useEffect to React.FC)
  • useMemo (add useMemo to React.FC)
  • useRef (add useRef to React.FC)
  • useForm (add useForm from react-hook-form to React.FC + handleSubmit function)