react-native-snippets
:pencil2: A collection of React Native snippets for Sublime Text and Atom
Details
Installs
- Total 54K
- Win 23K
- Mac 24K
- Linux 7K
Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 2 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 0 | 1 | 2 | 2 | 1 | 2 | 0 | 0 | 1 | 3 | 2 | 0 | 1 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 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
- 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