Skip to content

Instantly share code, notes, and snippets.

@aakagi
Created Mar 22, 2020
Embed
What would you like to do?
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