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

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.
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