-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Calling Actions.key() not reload the components Scene #3225
Comments
Do you have a sample code? I have no idea about what might be happening here. |
I made an example code to show you what i mean go here: https://github.com/pierol/rnrf-example it's an EXPO example try to open it in a ios simulator. Make login inside the app with these credentials: pierol and pw: giulia09. You have to swtch the version of react-native-router-flux from 4.0.0.beta.27 and 4.0.1 to see the two different behaviours. There is a console log in the DayList componenetWillMount method this component is part of the first Scene. After the Login is successfully i will make an Actions.choorHour() call to return to the first Scene, the one with the Daylist component. Only using 4.0.0.beta.27 will reload the component DayList when i return to the main scene from the Login form. |
Thank you for providing the example - I'll investigate further later tonight. |
The main point to be aware here is that RNRF had a major library upgrade ( |
In general i think that it's not the right behaviour do not refresh the components of a scene when you focus on it. The component could have in its componentWiilMount a fetch like in the example i made. Another solution could be to set in the an atttribute that specify if refresh or not, but it should refresh as default behaviour. |
That would not be a refresh - refreshing automatically a component would make sense if params were going to change - if they do not change, you will not get any reason the trigger |
Yes i understand what you mean :
Thats's right it could be a attribute in the Scene tag like :
|
This might get easier to fix with the proposal work that I am going to do in #3240. |
@pierol Now that I got deeper in that code a bit more - I believe you can get done using Other thing you might try too is to have a call with params: |
Sorry but with |
Sorry i didn't update the react-native-router-flux to the version 4.0.4, now it works with |
Version
Tell us which versions you are using:
Expected behaviour
Refresh of the components of Scene when it is called with:
Actions.key();
Actual behaviour
I update from react-native-router-flux 4.0.0.beta27 where the default behaviour was that when i called Actions.key() the components of the Scene were reloaded, but now it doesn't happen.
Probably i miss something new, some parameter ?
The text was updated successfully, but these errors were encountered: