GithubHelp home page GithubHelp logo

discountry / vscode-react-redux-react-router-snippets Goto Github PK

View Code? Open in Web Editor NEW
31.0 2.0 6.0 368 KB

vscode-react-redux-react-router-snippets

Home Page: https://marketplace.visualstudio.com/items?itemName=discountry.react-redux-react-router-snippets

License: MIT License

react vscode-extension

vscode-react-redux-react-router-snippets's Introduction

React/Redux/react-router Snippets CircleCI

Version Install Ratings

Useful React Ecosystem snippets for Visual Studio Code, including:

  • Quick import
  • React
  • Redux
  • react-redux
  • react-router

Screenshot

Screenshot

Usage

import

Trigger Content
imr import React from 'react'
imrc import React, { Component } from 'react'
imd import { render } from 'react-dom'
impt import PropTypes from 'prop-types'
imc import ${1:componentName} from './Components/${1:componentName}'
imconnect import { connect } from 'react-redux'
improvider import { Provider } from 'react-redux'
imcreateSelector import { createSelector } from 'reselect'
imrr import { BrowserRouter, Route } from 'react-router-dom'
imnl import { NavLink } from 'react-router-dom'
imwr import { withRouter } from 'react-router-dom'

React

Trigger Content
rcc→ class component skeleton
rccp→ class component skeleton with prop types after the class
rcjc→ class component skeleton without import and default export lines
rcfc→ class component skeleton that contains all the lifecycle methods
rsc→ stateless component skeleton
rscp→ stateless component with prop types skeleton
rpt→ empty propTypes declaration
spt→ static propTypes = {}
sdp→ static defaultProps = {}
con→ class default constructor with props
conc→ class default constructor with props and context
est→ empty state object
st→ Creates empty state object with ES7 synTax
cwm→ componentWillMount method
cdm→ componentDidMount method
cwr→ componentWillReceiveProps method
scu→ shouldComponentUpdate method
cwup→ componentWillUpdate method
cdup→ componentDidUpdate method
cwun→ componentWillUnmount method
cdc→ componentDidCatch method
ren→ render method
sst→ this.setState with object as parameter
ssf→ this.setState with function as parameter
props→ this.props
state→ this.state
bnd→ binds the this of method inside the constructor
pta→ PropTypes.array,
ptar→ PropTypes.array.isRequired,
ptb→ PropTypes.bool,
ptbr→ PropTypes.bool.isRequired,
ptf→ PropTypes.func,
ptfr→ PropTypes.func.isRequired,
ptn→ PropTypes.number,
ptnr→ PropTypes.number.isRequired,
pto→ PropTypes.object.,
ptor→ PropTypes.object.isRequired,
pts→ PropTypes.string,
ptsr→ PropTypes.string.isRequired,
ptnd→ PropTypes.node,
ptndr→ PropTypes.node.isRequired,
ptel→ PropTypes.element,
ptelr→ PropTypes.element.isRequired,
pti→ PropTypes.instanceOf(ClassName),
ptir→ PropTypes.instanceOf(ClassName).isRequired,
pte→ PropTypes.oneOf(['News', 'Photos']),
pter→ PropTypes.oneOf(['News', 'Photos']).isRequired,
ptet→ PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
ptetr→ PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
ptao→ PropTypes.arrayOf(PropTypes.number),
ptaor→ PropTypes.arrayOf(PropTypes.number).isRequired,
ptoo→ PropTypes.objectOf(PropTypes.number),
ptoor→ PropTypes.objectOf(PropTypes.number).isRequired,
ptsh→ PropTypes.shape({color: PropTypes.string, fontSize: PropTypes.number}),
ptshr→ PropTypes.shape({color: PropTypes.string, fontSize: PropTypes.number}).isRequired,

Redux

Trigger Content
rat Redux constant(actionTypes)
rac Redux actionCreator
reducer Redux reducer
store Redux store
selector Redux selector

react-redux

Trigger Content
imconnect import { connect } from 'react-redux'
improvider import { Provider } from 'react-redux'
provider react-redux Provider Container
mstp mapStateToProps
mdtp mapDispatchToProps
connect react-redux connect React Component
container Redux container

react-router

Trigger Content
imrr import { BrowserRouter as Router, Route } from 'react-router-dom'
imnl import { NavLink } from 'react-router-dom'
imwr import { withRouter } from 'react-router'
router react-router Router template
route react-router Route component
navlink react-router NavLink component

Contributors

Acknowledgments

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.