Tell us which versions you are using:
I want to use default wrapped navbar in tag
It won't be able to. You should move the state above the component as the NavBar cannot access another component's state.
If you want to use refresh, you can access it via this.props but I highly suggest a Flux implementation.
Yes, it seems we can only use refresh to update the props and use componentWillReceiveProps to update state
@jingpeng Maybe I've misunderstood something, but why you can't call refresh from onRight?
Oh, got it, you are talking about internal state of component... But for most cases you may use navigationState instead of component's state with RNRF...
Because I met a case that when clicking right button in NavBar, the internal component need to pop up a modal dialog, so I need to use 'refresh' method. @aksonov thanks for your explanation
@aksonov What do you mean by "But for most cases you may use navigationState instead of component's state with RNRF", and how does it solve @jingpeng challenge?
Right now I'm using redux for my app state, and when I need to show a dialog when pressing a button in the NavBar I have to update the app state, and then in componentWillReceiveProps check if I should show the dialog or not. Is there any smarter way of doing this, by using navigationState (or any smarter way in general?). Thanks in advance.
Most helpful comment
@aksonov What do you mean by "But for most cases you may use navigationState instead of component's state with RNRF", and how does it solve @jingpeng challenge?
Right now I'm using redux for my app state, and when I need to show a dialog when pressing a button in the NavBar I have to update the app state, and then in componentWillReceiveProps check if I should show the dialog or not. Is there any smarter way of doing this, by using navigationState (or any smarter way in general?). Thanks in advance.