Category : switch-statement

I’m trying to use switch() in my React Native app to handle what website a Webview should show. Hub.js: export default class Hub extends Component { … render() { return ( <View> <TouchableOpacity onPress={() => { this.props.navigation.navigate(‘Link’, { site: ‘Website 1’, }); }}> <Text>Website #1</Text> </TouchableOpacity> <TouchableOpacity onPress={() => { this.props.navigation.navigate(‘Link’, { site: ‘Website 2’, ..

Read more

I built a Switch-Case statament to be able to switch over given String like below: switch (identifier) { case "testButton": console.debug("Clicked test Button") case "cancelButton": console.debug("Clicked cancel Button") case "saveButton": console.debug("Clicked save Button") } I made a test for case "testButton" and what I become in console is: Clicked test Button Clicked cancel Button Clicked ..

Read more