Closed netsnatch closed 2 years ago
Got this:
class HeaderBar extends React.Component {
constructor(props) {
super(props)
this.logout = this.logout.bind(this);
}
render() {
return (
<View style={styles.container}>
<Text>
{this.props.children}
</Text>
<Menu
button={
<Image
style={{ width: 24, height: 24 }}
source={require('../assets/more.png')}
/>
}
>
<MenuItem OnPress={this.logout} >
Logout
</MenuItem>
</Menu>
</View>
)
}
logout() {
this.props.setToken(null)
this.props.setServer(null)
this.props.navigation.navigate('Home')
}
}
Doesn't work neither
Got this:
class HeaderBar extends React.Component { constructor(props) { super(props) this.logout = this.logout.bind(this); } render() { return ( <View style={styles.container}> <Text> {this.props.children} </Text> <Menu button={ <Image style={{ width: 24, height: 24 }} source={require('../assets/more.png')} /> } > <MenuItem OnPress={this.logout} > Logout </MenuItem> </Menu> </View> ) } logout() { this.props.setToken(null) this.props.setServer(null) this.props.navigation.navigate('Home') } }
Doesn't work neither
Got it working nevermind (needed a
TouchableHighlight onPress not working on iOS 14.4 react-native-material-menu: v1.2.0
And alert is not called.