Snippets List
Snippets |
Content |
rnc |
React native class component |
rnfc |
React native functional component |
rni |
React Native Index |
imr |
Import React |
ime |
Import React Native Element |
#Preview
React native class component (rnc)
//import liraries
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
// create a component
class $1 extends Component {
render() {
return (
<View style={styles.container}>
<Text>$1</Text>
</View>
);
}
}
// define your styles
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#2c3e50',
},
});
//make this component available to the app
export default $1;
Import React (imr)
import React from 'react';
Import React-Native Element (ime)
import { $1 } from 'react-native';
| |