Skip to content

Commit

Permalink
Stateless function snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
btcalls committed Feb 22, 2018
1 parent b18208c commit 3a89eb0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
25 changes: 25 additions & 0 deletions snippets/snippets.cson
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@
'flex: 1':
'prefix': 'f1'
'body': 'flex: ${1:1},$0'
'Create react-native Stateless function':
'prefix': 'rnstf'
'body': """
\'use strict\';
import React from \'react\';
import {
${4},
} from \'react-native\';
const ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}} = (props) => {
render() {
return (
${3:<View />}
);
}
}
const styles = StyleSheet.create({
});
export default ${2:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}};$0
"""
'React.PropTypes.':
'prefix': 'rpt'
'body': 'React.PropTypes.${1}$0'
Expand Down
28 changes: 28 additions & 0 deletions snippets/statelessFunction_react_native.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<snippet>
<content><![CDATA[
'use strict';
import React from 'react';
import {
${4},
} from 'react-native';
const ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}} = (props) => {
render() {
return (
${3:<View />}
);
}
}
const styles = StyleSheet.create({
});
export default ${2:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}};
]]></content>
<tabTrigger>rnstf</tabTrigger>
<scope>source.js,source.jsx</scope>
<description>Create react-native Stateless function</description>
</snippet>

0 comments on commit 3a89eb0

Please sign in to comment.