Skip to content

Instantly share code, notes, and snippets.

@aakagi
Created March 22, 2020 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aakagi/a0cd11fad28c5b69788fb77dbbfd5d9c to your computer and use it in GitHub Desktop.
Save aakagi/a0cd11fad28c5b69788fb77dbbfd5d9c to your computer and use it in GitHub Desktop.
import React from 'react';
import {
View,
Text,
StyleSheet,
ViewStyle,
StyleProp,
} from 'react-native';
interface Props {
style?: StyleProp<ViewStyle>;
}
const styles = StyleSheet.create({
container: {
},
});
const Name = (props: Props) => {
return (
<View style={[styles.container, props.style]}>
<Text>
</Text>
</View>
);
};
export default Name;
<snippet>
<content><![CDATA[
import React from 'react';
import {
View,
Text,
StyleSheet,
ViewStyle,
StyleProp,
} from 'react-native';
interface Props {
style?: StyleProp<ViewStyle>;
}
const styles = StyleSheet.create({
container: {
},
});
const ${1:name} = (props: Props) => {
return (
<View style={[styles.container, props.style]}>
<Text>
</Text>
</View>
);
};
export default ${1:name};
]]></content>
<tabTrigger>react-native-component</tabTrigger>
<scope>source.js</scope>
<description>Generic React Native Component</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment