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 42K
  • Win 17K
  • OS X 21K
  • Linux 4K
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 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 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
Windows 6 6 8 7 10 7 9 6 4 11 6 9 6 6 7 8 10 9 7 5 8 12 5 8 7 13 9 13 7 9 20 7 10 6 9 9 8 12 10 14 11 5 7 8 2 6
OS X 4 5 7 7 4 8 11 2 6 3 4 2 2 10 5 6 7 5 0 8 8 2 5 6 5 7 8 5 5 5 7 5 1 5 3 4 10 6 4 0 5 11 8 10 6 5
Linux 3 3 3 1 2 4 6 3 3 4 6 5 4 2 3 3 4 3 3 2 5 3 5 8 3 2 1 4 4 3 1 3 6 4 4 1 3 2 2 1 3 4 2 3 5 0

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