react-native-snippets
:pencil2: A collection of React Native snippets for Sublime Text and Atom
Details
Installs
- Total 54K
- Win 24K
- Mac 24K
- Linux 7K
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 | Apr 10 | Apr 9 | Apr 8 | Apr 7 | Apr 6 | Apr 5 | Apr 4 | Apr 3 | Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 2 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 |
Mac | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 1 | 0 | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 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