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