react-navigation 自定义返回按钮

需求在相应的页面实现自定义goback功能,支持回调方法。

 ...
 headerLeft: (
             navigation.state.params.handleSave()}
            />
        ),

 componentDidMount() {
        this.props.navigation.setParams({ handleSave: this._leftClick.bind(this) })
    }

    _leftClick=()=>{
        this.props.navigation.state.params.return_data()
        this.props.navigation.goBack()
    }

你可能感兴趣的:(react-navigation 自定义返回按钮)