Skip to content

Instantly share code, notes, and snippets.

@mimol91
Last active July 30, 2019 11:24
Show Gist options
  • Save mimol91/62ab326efb06408940f85421c9509f23 to your computer and use it in GitHub Desktop.
Save mimol91/62ab326efb06408940f85421c9509f23 to your computer and use it in GitHub Desktop.
resp
data = {
"state":{
"counter":2
},
"bindings": {
onClickButton : ({navigation}, setState) => () => {
setState((state) => ({counter: state.counter + 1}))
//setState({counter: 5})
setTimeout(()=>{
navigation.navigate('Home')
}, 1000)
}
},
"components": {Button, View, Text},
"jsx": '<View><Button title="Learn More" onPress={onClickButton(props,setState)}/><Text>{state.counter}</Text></View>'
}
<Text>ABC</Text>
<Tx>abc</Tx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment