如何在React导航导航选项中实现条件?
static navigationOptions = { headerTitle: this.props.moneyContext === 'Send' ? 'Send money' : 'Receive money', };
moneyContext取决于打开的屏幕并从商店获取数据。
谢谢!
您可以尝试使用setParams:
navigation.setParams({ param: value })
有关更多详细信息,请参阅documentation on headers。