Skip to content

Instantly share code, notes, and snippets.

@roshangm1
Last active March 21, 2023 12:53
Show Gist options
  • Save roshangm1/18713918970ca7c76d874f62b8e88fc0 to your computer and use it in GitHub Desktop.
Save roshangm1/18713918970ca7c76d874f62b8e88fc0 to your computer and use it in GitHub Desktop.
Stateless component
import React from 'react';
import {
Dimensions,
StyleSheet,
Text,
View,
} from 'react-native';
const { width } = Dimensions.get('window');
const Card = props => {
return (
<View style={[styles.cardWrapper, props.style]}>
{props.children}
</View>
);
}
const styles = StyleSheet.create({
cardWrapper: {
height: 50,
width: width - 20,
marginTop: 20,
marginLeft: 10,
borderRadius:4,
borderWidth: 1,
borderColor: '#d6d7da',
},
})
export { Card };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment