ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

react-native-snippets

by shrugs ALL Trending

:pencil2: A collection of React Native snippets for Sublime Text and Atom

Details

Installs

  • Total 47K
  • Win 20K
  • Mac 22K
  • Linux 5K
Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23
Windows 2 19 15 5 6 12 7 12 12 7 6 5 8 13 11 8 7 6 11 9 7 12 7 8 5 6 10 4 12 11 10 4 6 7 7 13 10 7 4 6 11 8 5 11 9 5
Mac 4 5 4 4 2 3 8 4 4 3 2 5 4 3 6 8 6 4 4 1 3 6 6 4 3 0 3 6 8 1 6 1 4 3 3 7 6 6 0 6 4 6 4 7 3 3
Linux 1 1 6 2 3 1 2 2 4 1 5 2 5 2 0 2 7 1 4 3 1 3 1 2 0 2 2 5 3 4 2 0 1 1 2 4 3 2 3 1 1 2 2 3 4 3

Readme

Source
raw.​githubusercontent.​com

[Looking for Maintainer] react-native-snippets

A collection of React Native snippets for Sublime Text and Atom.

These snippets use ES6/7 syntax.

Install

Install by searching for react-native-snippets in Package Control

For Atom, search for react-native-snippets-horse in the Atom Package Manager.

Snippets

Snippet Tab Trigger Description
React Native Create Class rncc Scaffolds a full react-native component class.
React Native Create Stateless Function rnstf Scaffolds a stateless function.
this.setState() tss
Create StyleSheet css Scaffolds a StyleSheet-only module.
StyleSheet.create() ssc Shortcut for creating a StyleSheet inline.
React.PropTypes. rpt
export default ed

Lifecycle Methods

Snippet Tab Trigger
constructor() constructor()
componentWillMount() cwm
componentDidMount() cdm
componentWillUnMount() cwum
componentDidUnMount() cdum
componentWillUpdate() cwud
componentDidUpdate() cdud
componentWillReceiveProps() cwrp
shouldComponentUpdate() scud
static propTypes = {} propTypes
static defaultProps = {} defaultProps
flex: 1 f1
alignItems: ‘center’ ai
justifyContent: ‘center’ jc

Components

Snippet Tab Trigger
ActivityIndicatorIOS rnActivityIndicatorIOS
DatePickerIOS rnDatePickerIOS
Image rnImage
ListView rnListView
Navigator rnNavigator
NavigatorIOS rnNavigatorIOS
PickerIOS rnPickerIOS
Text rnText
TouchableHighlight rnTouchableHighlight
View rnView

Some snippets heavily inspired by sublime-react.

TODO

  • Flow Type Checking Annotations

Contributing

  1. Create your snippet.
  2. Postfix your snippets with _react_native.
  3. Generate the Atom snippet file (make install && make atom)
  4. Add them to the README
  5. Submit a Pull Request
  6. ???
  7. Profit!

Try to make your snippet tab triggers follow a syllable-based fuzzy-search style. For example for componentWillUpdate(), cwud is preferred over cwup.

LICENSE

MIT, see LICENSE