The problem is that the entire navigation stack is connected to the repository (since the components are not unmounted unless you use resetto or resetnavigation)
For what stands here is what I am doing right now. I worked with a slightly modified implementation of reaction reduction, which skips updates for scenes that are not displayed (see below).
To use it, you need:
Saving a route for a single component tree in context
We created a wrapper for this.
const CurrentRoute = React.createClass({ childContextTypes : { currentRoute: PropTypes.object }, getChildContext() { return { currentRoute: this.props.route } }, render() { return this.props.children; } })
And use it in the rendering area
<CurrentRoute route={route}><CurrentScene navigate={navigate} route={route} index={index} /></CurrentRoute>
You can then access the route to which the component was added.
Keep the navigation stack in singleton mode. We use this code in the scene configuration.
let routeStack = []; export const updateRouteStack = stack => routeStack = stack;
Then you can use this slightly modified connect-redux connect function, it skips updates if the component is displayed in another component tree and then displayed (or a similar implementation) https://github.com/reactjs/react-redux/compare/master ... ganmor: master
It may be possible to pack it, but I did not have time to study it. If anyone wants to do this .. Hope that helps
source share