Custom Button
Wed Mar 16 2022 11:15:58 GMT+0000 (Coordinated Universal Time)
Saved by
@markmarleydev
MainButton.js
import {View, Text, Stylesheet, TouchableOpacity}
const MainButton = props => {
return (
<TouchableOpacity onPress{props.onPress}>
<View style={styles.button}>
<Text style={styles.buttonText}> {props.children} </Text>
</View>
</TouchableOpacity>
)
}
const styles = StyleSheet.create({
button: {
styles etc
}
buttonText:{
styles etc
}
})
export default MainButton
//Different file
import MainButton from "FILE-LOCATION"
<MainButton onpress={ADD-FUNCTION-LOGIC}>
START GAME
</MainButton>
content_copyCOPY
Comments