react-native-snippets
A collection of Sublime Text snippets for react-native.
These snippets use ES6 syntax.
Install
Install via Package Control by searching for react-native-snippets
.
Snippets
Snippet | Tab Trigger | Description |
---|---|---|
React Native Create Class | rncc | Scaffolds a full react-native component class. |
this.setState() | tss | |
Create StyleSheet | css | Scaffolds a StyleSheet-only module. |
StyleSheet.create() | ssc | Shortcut for creating a StyleSheet inline. |
React.PropTypes. | rpt |
Lifecycle Methods
Snippet | Tab Trigger |
---|---|
constructor() | constructor() |
componentWillMount() | cwm |
componentDidMount() | cdm |
componentWillUnMount() | cwum |
componentDidUnMount() | cdum |
componentWillUpdate() | cwud |
componentDidUpdate() | cdud |
componentWillReceiveProps() | cwrp |
shouldComponentUpdate() | scud |
.propTypes = {} | propTypes |
.defaultProps = {} | defaultProps |
flex: 1 | f1 |
alignItems: 'center' | ai |
justifyContent: 'center' | jc |
Components
Snippet | Tab Trigger |
---|---|
ActivityIndicatorIOS | <ActivityIndicatorIOS |
DatePickerIOS | <DatePickerIOS |
Image | <Image |
ListView | <ListView |
Navigator | <Navigator |
NavigatorIOS | <NavigatorIOS |
PickerIOS | <PickerIOS |
Text | <Text |
TouchableHighlight | <TouchableHighlight |
View | <View |
Some snippets heavily inspired by sublime-react.
TODO
- Flow Type Checking Annotations
Contributing
- Create your snippet.
- Postfix your snippets with
_react_native
. - 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