vcs-react-snippets

A useful and fruitful group of react/react native snippets (no semi-colons here)

vascocsilva

476

0

0.1.11

MIT

GitHub

A screenshot of your package

vcs-react-snippets

A group of useful and fruitful snippets for react and react native development. No semi-colons, just because. Mostly for my own personal needs, check if it can be of any good to you 😀

Usage

Prefix Description
rcb→/cc→ Curly braces with input inside, spaced { input }
rfc→ React functional component
rfcp→ React functional component, without props (cleaner)
rcc→ React classful component
rccc→ React classful component, without props (cleaner)
rcon Component constructor
rwm→ Component will mount
rdm Component did mount
rwu→ Component will update
rdu→ Component did update
rwp→ Component will receive props
rsu→ Component should update
rim→ Import statement with curly braces
ri→ Import statement without curly braces
rid→ Import statement for ReactDom
rin→ Import for react native
rip→ Import for PropTypes
ripd→ Import for PropTypes, with destructuring
ris→ Import styled components
rts→ this.state.${}
rsst→ this.setState()
rtp→ this.props.${}
rpt→ MyComponent.propTypes = {}
rdpt→ MyComponent.defaultProps = {}
rst→ const styles = {}, often used in react native
rsc→ Styled Component initialization: `const $StyledComponent = styled.$tag```
rdst→ destructuring of styles: const { } = styles
rdp→ destructuring of props: const { } = this.props
rds→ destructuring of state: const { } = this.state
/**→ long comment for documentation purposes /** some comment **/
rxac→ constant declaration typically used in redux actions export ACTION_NAME = 'ACTION_NAME'
rxmsp→ redux mapStateToProps