-
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
Actions.refresh not working #2518
Comments
+1 public componentWillMount (): void {
Actions.refresh({
renderBackButton: this.renderBackButton.bind(this),
onRight: this.onRightButtonPress.bind(this)
});
} It's not working. I think it's same issue. |
Try |
@kesha-antonov It's not working. I create new issue for this. |
It works for me. rnrf-4-beta22
|
public componentWillMount (): void { |
Jesus, I came here looking for an answer for the original issue. |
I'm having the same issue BUT when updating the store (mobx) @observer
class Custom extends Component {
render() {
// prints every time I update state, this's ok!
console.log('update', store.session.get('logged'))
return (
<Router>
<Scene key="root">
<Scene key="login"
component={login}
type="replace"
onEnter={() => {
// ONLY enter here once
console.log('onEnter');
return store.session.get('logged')
}}
success="recents"
/>
<Scene key="recents" component={recents} />
</Scene>
</Router>
)
}
} I tried to trigger the 're-render' calling _onPressButton() {
store.session.set('logged', !store.session.get('logged')) // invert the value in store
Actions.refresh() // tested with { key: 'login' } too
} @aksonov Could you please point us to the right direction? 🙏 |
Hi I have the same problem ... When i try to refresh with Actions.refresh() nothing happen
|
same issue here, I am using redux and when I try to refresh the right button it just doesn't update. |
Please reproduce the issue with Example project. |
@jaysassyinfotech |
@cosinus84 You sir are a lifesaver. |
@cosinus84 It is really work. wow |
@cosinus84 you rock man (y) |
Hopefully random is not needed for latest version now |
@aksonov Please can you list down the props (with their functions ) that we can use in Actions.refresh() as the Scene props don't seem to be working here. |
You may check Example app and its refresh calls - it works fine there with latest 4.0.5. Feel free to clone and modify example accordingly to demonstrate the issue. |
Yes, it is working fine but I suggest you to make a list of props to be used with refresh calls as we may not know which one to use when. |
its working |
@preetluv mind telling me how you fixed it? |
@preetluv see cosinus84's answer |
you can do following:-
You can check the "yourProp" in componentWillReceiveProps in previus screen after doing back. |
I use |
Version
Tell us which versions you are using:
Expected behaviour
Actions.refresh() refresh the current scene.
If my approach was wrong, or Actions.refresh has some requirement, please provide me with the information
Actual behaviour
When i was at search scene (plain component with state), i was trying to refresh the scene by using Actions.refresh. But somehow it didn't work at all.
Steps to reproduce
The text was updated successfully, but these errors were encountered: