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

Transition history using this same scene but with other parameters #3166

Closed
bialasik opened this issue Aug 10, 2018 · 4 comments
Closed

Transition history using this same scene but with other parameters #3166

bialasik opened this issue Aug 10, 2018 · 4 comments

Comments

@bialasik
Copy link

bialasik commented Aug 10, 2018

Hello,
I'm creating a shop app and I'm using react-native-router-flux as a router.
Currently I have just few scenes like product list, product info, basket, checkout.

But I need to create a navigation. I have JSON with whole navigation structure, where ID of category is the ID for call to API when ProductList scene calls componentDidMount().

But I don't know how to
a) use this same scene but with additional parameters and refresh it -- I suppose that I should do something like Actions.refresh({ key: PRODUCT_LIST, params: { categoryId: 12345 } })?
b) how to handle this same scene transitions history? I mean if I'll do some Actions.refresh() how can I go back to previous categories I refreshed before?

As a state manager in the app, I'm using Redux. But I'm not using it for router (I had some issues to pair RNRF and Redux).

Or maybe you have other ideas how to handle this case?

Best regards,
Marcin

@aksonov
Copy link
Owner

aksonov commented Aug 10, 2018

Just do usual 'push', like Actions.productList({categoryId: 123}), you will have just two components in the stack.

@aksonov
Copy link
Owner

aksonov commented Aug 10, 2018

For Redux integration, change ReduxExample

@bialasik
Copy link
Author

And even if I'll do some pushes on this same scene but with different parameters, I can go back to old state?

@aksonov
Copy link
Owner

aksonov commented Aug 10, 2018

"<" button ? Sorry, github is for issues not for questions, please post the question to StackOverflow

@aksonov aksonov closed this as completed Aug 10, 2018
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

2 participants