I'm trying to implement a custom button using TouchableHighlight
I created a button class and I'm importing it into my main program like this:
In button.js:
export default class Button extends React.Component {
render() {
return (
<TouchableHighlight>
<View style={styles.button}>
<Text style={styles.buttonText}>
</Text>
</View>
</TouchableHighlight>
)
}
}
In app.js:
import Button from './button'
<View>
<Button onPress={ () => navigate('Chat', { user: 'Abe' })} title = "Abe"
/>
</View>
When I run this, I just get a blank button with no text or onPress event.
How can I pass in the onPress and title values to the Button class?
Thanks!