react-native-snippets
:pencil2: A collection of React Native snippets for Sublime Text and Atom
Details
Installs
- Total 40K
- Win 16K
- OS X 20K
- Linux 4K
Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 8 | 19 | 17 | 16 | 11 | 9 | 9 | 15 | 14 | 18 | 14 | 17 | 12 | 6 | 6 | 10 | 12 | 13 | 10 | 8 | 12 | 7 | 8 | 14 | 17 | 15 | 6 | 10 | 11 | 9 | 12 | 11 | 11 | 14 | 9 | 8 | 12 | 12 | 12 | 7 | 6 | 0 | 0 | 15 | 18 |
OS X | 3 | 7 | 8 | 12 | 7 | 3 | 4 | 5 | 1 | 9 | 7 | 9 | 8 | 5 | 2 | 1 | 4 | 7 | 5 | 7 | 4 | 7 | 3 | 5 | 9 | 5 | 8 | 5 | 3 | 6 | 4 | 6 | 4 | 9 | 2 | 7 | 10 | 7 | 7 | 8 | 4 | 2 | 0 | 1 | 11 | 12 |
Linux | 1 | 3 | 6 | 0 | 2 | 8 | 2 | 7 | 4 | 4 | 10 | 2 | 3 | 4 | 0 | 0 | 3 | 7 | 4 | 3 | 1 | 1 | 2 | 4 | 2 | 4 | 4 | 4 | 5 | 4 | 5 | 7 | 0 | 2 | 4 | 7 | 7 | 8 | 6 | 7 | 1 | 1 | 0 | 0 | 5 | 1 |
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
- Create your snippet.
- Postfix your snippets with
_react_native
. - Generate the Atom snippet file (
make install && make atom
) - Add them to the README
- Submit a Pull Request
- ???
- 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