Actions.refresh issue .. not updating scene.
See original GitHub issueHi, I am attempting to update my scene to add renderRightButton via Actions.refresh however I cannot seem to get it to work.
"react-native-router-flux": "4.0.6"
Even if I try this:
componentDidMount = () => {
Actions.refresh({rightTitle: 'TEST'});
}
I cannot even change the Title of the scene, let alone renderRightButton.
I have tried:
componentDidMount = () => {
Actions.refresh({renderRightButton: this.renderRightButton()});
}
and
renderRightButton = (props) => {
return (
<TouchableOpacity
style={{ paddingRight: 10, paddingLeft: 20 }}
onPress={() => Actions.refs.home.wrappedInstance.getNextGames()}>
<Ionicons name="ios-arrow-forward" size={25} {...DefaultProps.icons} />
</TouchableOpacity>
);
}
The only way I can make it work is if I declare it with the static function…
static renderRightButton = (props) => {
return (
<TouchableOpacity
style={{ paddingRight: 10, paddingLeft: 20 }}
onPress={() => Actions.refs.home.wrappedInstance.getNextGames()}>
<Ionicons name="ios-arrow-forward" size={25} {...DefaultProps.icons} />
</TouchableOpacity>
);
}
However using the static function make its more difficult to control the functionality (I need to disable the button if there are no next games etc…
My navigation is set up as follows:
<Stack hideNavBar>
<Tabs
key="tabbar"
swipeEnabled
type="replace"
showLabel={true}
{...DefaultProps.tabProps} >
<Stack
key="gameday"
icon={() => <SimpleLineIcons name="rocket" size={20} {...DefaultProps.icons} />}
{...DefaultProps.navbarProps}>
<Scene
key="home"
component={GameDayContainer}
initial
/>
</Stack>
The “home” scene is the one I am trying to refresh.
Any help would be much appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
React Native router-flux reload the current scene
Simply use this: Actions.refresh({key: Math.random()});.
Read more >How to refresh screen of reactive app? - OutSystems
In reactive web you do not need to refresh the screen because as soon as variables/aggregates are updated the screen refresh to show...
Read more >KASA app scenes broken after update : r/TPLinkKasa - Reddit
I tried creating a new scene but that doesn't work either. Is this a known bug that needs fixing? What can I do?...
Read more >How to use the react-native-router-flux.Actions.refresh function ...
sorted("timestamp", true); // When the list of projects change, React won't know about it because the Result object itself did not change. projects.addListener( ......
Read more >Prevent automatic opening of scene for users after new update
It doesn't appear that this indicates to the user there is a newer version of the model for them to reload however? So...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have downgraded to
4.0.0-beta.31
.Actions.refresh
works with that version though.I will most likely be migrating to
react-native-nagivation
later on in the week.this solution doesn’t work for me
so, this is my solution to render my right button: