Header Hooks
complete
Jake Coxon
Often content of the header needs to reflect state that's available in the screen's component. Currently to do this you have to modify params along with the state change, but it's harder to do when the state change happens externally.
Another issue is that often the callback from header buttons need to use the screen component state in order to perform a task.
My suggestion is a set of header hooks that allows you to update the header in reaction to state changes in a much more declarative way.
It is possible to do this in user space (as hooks or as a <Header /> component that renders nothing) but it requires a weird mix of context, callbacks and boilerplate, so being built into the library would be much cleaner imo
satya164
complete
React Navigation 5 has
navigation.setOptions
to update options such as headerJake Coxon
satya164: Thanks! that works