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

react-native-snippets

by Shrugs ST2/ST3

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

Details

Installs

  • Total 28K
  • Win 10K
  • OS X 15K
  • Linux 3K
Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28
Windows 14 22 8 9 19 17 16 22 14 12 14 13 24 15 21 16 8 12 12 12 27 23 19 10 12 10 8 18 21 19 13 6 22 25 20 15 15 13 7 21 23 19 21 18 8 9
OS X 7 9 6 9 13 20 14 14 18 5 9 14 25 13 17 19 11 8 12 16 18 20 19 8 8 16 17 29 20 15 15 13 27 20 19 14 24 10 12 23 42 19 26 16 10 7
Linux 3 4 5 1 2 8 5 4 5 3 3 5 4 2 9 3 4 4 3 0 4 3 3 4 1 5 6 4 2 1 3 3 1 5 6 5 5 1 2 7 4 3 5 4 4 3

Readme

Source
raw.​githubusercontent.​com

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.
this.setState() tss
Create StyleSheet css Scaffolds a StyleSheet-only module.
StyleSheet.create() ssc Shortcut for creating a StyleSheet inline.
React.PropTypes. rpt

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