aksonov / aksonov/react-native-router-flux

Scene/Navigation title/Left/Right is not updated while title={title} value was changed

Open
#3,318 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8.9k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

Version
- react-native-router-flux v^4.0.5
- react v16.5.0
- react-native v0.57.1

Actual behaviour

Scene props is not changed. Static. While i see logs that prop was changed.

Steps to reproduce

class A {
onPress = () => {
Actions.push('B')
}
}

class B {
#Failure:
componentDidMount() {
Actions.refresh({
leftTitle: 'Add',
onLeft: () => {
// TODO
alert('3456')
},
rightTitle: 'decrease',
onRight: () => {
// TODO
alert('123');
}
});
}

#Failure:
componentWillReceiveProps() {
Actions.refresh({
leftTitle: 'Add',
onLeft: () => {
// TODO
alert('3456')
},
rightTitle: 'decrease',
onRight: () => {
// TODO
alert('123');
}
});
}

#BUT:

render(){
return(

)
}

#SUCCESS:
change = () => {
Actions.refresh({
leftTitle: 'Add',
onLeft: () => {
// TODO
alert('3456')
},
rightTitle: 'decrease',
onRight: () => {
// TODO
alert('123');
}
});
};
}

when this component re-renders, scene's title is not updated.

so,How to use Actions.refresh?? OR other refreshing navigation methods?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.