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>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter