question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Actions.refresh renderRightButton has no effect

See original GitHub issue

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.1 (v3 is not supported)
  • react-native v0.56.0

Expected behaviour

The navbar refreshes with the new right button component

Actual behaviour

No effect

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.

  static onEnter = () => {
    const { wrappedInstance } = Actions.refs.profile

    // this works
    Actions.refresh({
      rightTitle: "Logout",
      onRight: wrappedInstance.onLogout
    })

   // this has no effect
   Actions.refresh({
      renderRightButton: () => <MoreButton onPress={() => alert('hi')} />
   })
  }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
waqas19921commented, Dec 26, 2019

For react-navigation version 3.X use following example May be it also works with 4.x

class Companies extends Component {

    componentDidMount(){
        Actions.refresh({
          right: () => (
              <MaterialIcons
                name={'mail'}
                size={48}
                color={'black'} />
          )
        })
     } 

    render(){
      ...
    }
}
2reactions
jamesholcombcommented, Aug 27, 2018

Here is how I worked around it

        <Scene
          back
          key={routes.PROFILE}
          component={ProfileScene}
          renderRightButton={
            <MoreButton
              onPress={() => Actions.refs.profile.wrappedInstance.onMorePress()}
            />
          }
          title="Profile"
        />
Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-router-flux/CHANGELOG.md - UNPKG
53, - Actions.refresh renderRightButton has no effect [\#3218](https://github.com/aksonov/react-native-router-flux/issues/3218).
Read more >
Actions.refresh navigation - react native - Stack Overflow
I use react-native-router-flux for my navigation. I have a problem with Actions.refresh(). When I execute it nothing happen ... import React, { ...
Read more >
react-native-router-flux | Yarn - Package Manager
react-native-router-flux is a different API over react-navigation . It helps users to define all the routes in ... getStateForAction is not a function...
Read more >
aksonov/react-native-router-flux - Gitter
How to get the current route from the sidebar? Actions.currentRouter.currentRoute is not working. Adrian ...
Read more >
Padding At The Top Is Coming While Using Drawer ("React-Native ...
React Native Navigation Drawer is a very popular component in app development. ... Actions.refresh renderRightButton has no effect #3218; hideTabBar is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found