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

renderRightButton Actions.refresh() not working #3119

Closed
zouminhua-1 opened this issue Jul 9, 2018 · 3 comments
Closed

renderRightButton Actions.refresh() not working #3119

zouminhua-1 opened this issue Jul 9, 2018 · 3 comments

Comments

@zouminhua-1
Copy link

"react-native": "0.55.4"
"react-native-router-flux": "^4.0.0-beta.31"

in my code :
renderRightButton = () => (
<TouchableOpacity
onPress={() => {
DeviceEventEmitter.emit(TYPE.EDIT_ADDRESS_BOOK);
}}
>
<Text style={{ color: '#33ccff', fontSize: 20, marginRight: 20 }}>Edit

)

componentDidMount() {
    Actions.refresh({ renderRightButton: this.renderRightButton });
}
@zouminhua-1
Copy link
Author

using right insteadof renderRightButton

@Rynxiao
Copy link

Rynxiao commented Sep 30, 2018

using setTimeout my be help

 componentDidMount() {
    setTimeout(() => {
        Actions.refresh({ renderRightButton: this.renderRightButton });
    }, delayTime)
  } 

the scene key is prev navigation's when redux update data

the code in navigationStore.js Line 930

const { key } = getActiveState(this.state);

@fozhao
Copy link

fozhao commented Jun 13, 2019

I saw quite a few people mentioning the setTimeout fix. I tried it with renderRightButton, didn't work. However, using right does work. Thanks @zouminhuababa, life saver. And I am surprised that I can't find right in any API doc. @aksonov, is that deprecated or something else?

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

3 participants