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

How can i get the props after Actions.popTo in the previous scene? #3241

Closed
arfaWong opened this issue Sep 3, 2018 · 4 comments
Closed

How can i get the props after Actions.popTo in the previous scene? #3241

arfaWong opened this issue Sep 3, 2018 · 4 comments

Comments

@arfaWong
Copy link

arfaWong commented Sep 3, 2018

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.1
  • react-native v0.55.4

Expected behaviour

Actions.push
SceneA ==> SceneB

Actions.popTo
SceneB ==> SceneA

How can i get the props in SceneA?

@dextermb
Copy link
Contributor

dextermb commented Sep 3, 2018

According to the API documentation, there is a second parameter on popTo that is an object for your props.

Property Type Parameters Description
[key] Function Object The Actions object "automagically" uses the Scene's key prop in the Router to navigate. To navigate to a scene, call Actions.key() or Actions[key].call().
currentScene String Returns the current scene that is active
jump Function (sceneKey: String, props: Object) used to switch to a new tab. For Tabs only.
pop Function Go back to the previous scene by "popping" the current scene off the nav stack
popTo Function (sceneKey: String, props: Object) Pops the navigation stack until the Scene with the specified key is reached.
push Function (sceneKey: String, props: Object) Pushes the scene to the stack, performing a transition to the new scene.
refresh Function (props: Object) Reloads the current scene by loading new props into the Scene
replace Function (sceneKey: String, props: Object) Pops the current scene from the stack and pushes the new scene to the navigation stack. *No transition will occur.
reset Function (sceneKey: String, props: Object) Clears the routing stack and pushes the scene into the first index. No transition will occur.
drawerOpen Function Opens the Drawer if applicable
drawerClose Function Closes the Drawer if applicable
create React.Element pass Scene to create your app navigator. It is alternative router creation method mostly used for Redux integration

@arfaWong
Copy link
Author

arfaWong commented Sep 3, 2018

@dextermb I have seen that API documentation, but it doesn't seem to work.

@dextermb
Copy link
Contributor

dextermb commented Sep 3, 2018

@arfaWong Probably in relation to #3206.

cc @daviscabral @aksonov

@daviscabral
Copy link
Collaborator

Yes, thank @dextermb, we can continue this over there. But before doing that it's important to notice that things changed from 1.x to 2.x on react-navigation, making a lot of RNRF API to also change (that's the main reason why this went from v3 to v4.

Please read #3206 and see if you think you can contribute there with more information about your problem or that you can help with a PR.

Repository owner locked and limited conversation to collaborators Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants