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 26K
  • Win 9K
  • OS X 15K
  • Linux 2K
Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2
Windows 0 14 14 12 10 17 7 20 12 11 22 12 12 11 13 10 9 13 16 29 28 18 9 10 20 9 16 17 29 35 9 14 33 28 33 32 17 15 8 21 27 22 18 15 9 5
OS X 0 18 12 7 20 9 9 23 16 11 12 8 12 12 9 15 5 10 15 18 15 21 18 6 15 30 26 24 22 26 13 24 24 33 25 26 15 13 12 13 24 23 23 27 6 8
Linux 0 2 8 3 2 3 6 5 1 2 4 3 2 6 7 4 1 3 3 3 4 4 4 6 3 3 2 0 2 7 4 6 3 8 4 11 2 3 3 3 4 7 10 2 0 4

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