Closed sinan-aumarah closed 7 years ago
@AMitchemTW Thanks. Agreed with your points. As for the connectedRouter; this is the only thing that worked for me with react-router v4 and history.push(). There is a compatibility bug with redux-router and react-router v4 and connectedRouter to fix it.
Hi all,
So I think think this is the cleanest solution (I might be biased :stuck_out_tongue: ). From a student perspective, it's very simple now to attach and reconfigure buttons based on which screen you're on.
So now we don't have handler mappers or anything hacky. it's as simple as wrapping the screen component with WithButtonConfigs(screenComponent, newButtonConfigs{}) i.e.
WithButtonConfigs is an HOC redux container that wraps the screen component and trigger dispatch(REMAP_BUTTONS action) once the screen component is mounted. This action will change the state of the buttons and thus remap them on page view/navigation.
Note: the top and bottom buttons are set to scroll up or down by default and we probably don't need to overwrite them.
Let me know what you think