Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

success handler not working (v4) #2498

Closed
nisheetsun opened this issue Oct 12, 2017 · 1 comment
Closed

success handler not working (v4) #2498

nisheetsun opened this issue Oct 12, 2017 · 1 comment

Comments

@nisheetsun
Copy link

nisheetsun commented Oct 12, 2017

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.21
  • react-native v0.49.3

Expected behaviour

Success handler to work.

const App = () => { return ( <Router> <Scene key="root"> <Scene key="scarlet" component={ScarletScreen} title="Scarlet" initial /> <Scene key="gray" //success='green' onEnter={()=>{Alert.alert("onEnter!")}} success={()=>{Alert.alert("success!")}} component={GrayScreen} title="Gray" /> <Scene key='green' component={GreenScreen} title="Green" /> </Scene> </Router> ); }

Actual behaviour

Success handler is not working, but onEnter is working. I also tried to pass string(key) to success.

Steps to reproduce

App.js code:
const App = () => { return ( <Router> <Scene key="root"> <Scene key="scarlet" component={ScarletScreen} title="Scarlet" initial /> <Scene key="gray" //success='green' onEnter={()=>{Alert.alert("onEnter!")}} success={()=>{Alert.alert("success!")}} component={GrayScreen} title="Gray" /> <Scene key='green' component={GrayScreen} title="Gray" /> </Scene> </Router> ); }

ScarletScreen.js code:
const ScarletScreen = () => { return ( <View style={styles.container}> <Text style={styles.welcome} onPress={() => Actions.gray()}> Scarlet Screen </Text> </View> ); }

GrayScreen.js:
const GrayScreen = () => { return ( <View style={styles.container}> <Text style={styles.welcome} onPress={() => Actions.green()}> GrayScreen </Text> </View> ); }

GreenScreen.js:
const GreenScreen = () => { return ( <View style={styles.container}> <Text style={styles.welcome} onPress={() => Actions.scarlet()}> GreenScreen </Text> </View> ); }

@nisheetsun
Copy link
Author

my bad, I was not "truly" returning from onEnter/on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant