Closed me6iaton closed 8 years ago
What's the benefit to store reducer key in context?
config reducer key in root router component, once, and use connectMultireducer in deep components with the same key
Seems your commit is based on the version 2, connectMultireducer
has been removed in version 3. If you want pass reducer key down to the child components, you can create context by yourself in version 3:
class ListComponent extends Component {
static propTypes = {
as: PropTypes.string.isRequired
}
static childContextTypes = {
as: PropTypes.string.isRequired
}
getChildContext() {
return { as: this.props.as }
}
render() {
return (
<div>
<Item />
</div>
);
}
}
i see, thanks
One of the options - store multireducer key in react context, here is my experiment for this https://github.com/me6iaton/multireducer/commit/a15f58620580d254e6197c34a493c64055e95f67