• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

react-redux-react-native-snippets

Snippets for React and Redux for help developer to be faster.
  • #react
  • #redux
  • #snippets
  • #react-native
  • #es6
EQuimper
11,835
4
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

react-redux-react-native-snippets-snippets package

Some snippets for React/React-Native and Redux for help you to be a faster developer. I try to make it really easy to remember.

Help for:

  • React-Native-Router-Flux
  • React-Router

More will coming soon.

React

imr Import React

import React from 'react';

imrc Import Component React

import React, { Component } from 'react';

sl Stateless Component

const ${1} = () => (
  ${2}
);
 
export default ${1};

rrr React-Router route

<Route path="${1}" component={${2}} />

ed Export Default

export default ${1};

r return

return ${1};

rcc class React component es6

class ${1} extends Component {
  render() {
    return (
      ${2}
    );
  }
}
 
export default ${1};

React Component Lifecycle

cwm componentWillMount

componentWillMount() {
  ${1}
}

cdm componentDidMount

componentDidMount() {
  ${1}
}

cwum componentWillUnmount

componentWillUnmount() {
  ${1}
}

cwu componentWillUpdate

componentWillUpdate() {
  ${1}
}

cdu componentDidUpdate

componentDidUpdate() {
  ${1}
}

Redux

'ins' INITIAL_STATE

const INITIAL_STATE = {
  ${1}
};

rrd Redux Reducer

export default (state = INITIAL_STATE, action) => {
  switch (action.type) {
    case ${1}:
    default:
      return state;
  }
};

rt Redux Types

export const ${1} = '${1}';

React-Native

imrn Import React-Native

import { ${1} } from 'react-native';

rnvt React-Native Text and View

import {
  View,
  Text
} from 'react-native';

rnsc React-Native scene

<Scene
  key="${1}"
  title="${2}"
  component={${3}}
/>

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by