/React-Code-Snippets

Custom code snippets which you could easily use with code editor of your choice.

React Code Snippets

This repository contains custom code snippets which you could easily use with code editor of your choice.

Snippets

  1. Create a react component with redux connect and hooks.
    Prefix: redux

    • Creates funtional component
    • Automatically imports useEffect, useState and connect
    • Methods like mapStateToProps and mapDisaptchToProps are created to save further time
    • Component is wrapped with connect HOC
  2. Create a React Functional Component.
    Prefix: rfc

    • Creates funtional component
    • Automatically imports useEffect & useState
    • Name of the function will be auto generated from FileName
  3. Create a React Class Component.
    Prefix: rcc

    • Creates class component
    • Automatically create a state (with dropdown feature to select type of state [ ] | '' | null)
    • Name of the function will be auto generated from FileName

How to use?

  1. Navigate to File > Preferences > User Snippets
  2. Select JavaScript(JS) as language and javascript.json file would be opened.
  3. Replace or Amend the contents of the file with repository's javascript.json file.