aboeglin / react-router-v4-transition

React Router V4 Transition
MIT License
39 stars 6 forks source link

Fix prop issue #8

Closed aboeglin closed 7 years ago

aboeglin commented 7 years ago

In the current release, the props given to the components under the TransitionSwitch are not dynamic anymore. This is due to the fact that we store a clone from this.props.children in the internal state of TransitionSwitch.

The current solution is to only store the key in the state, and in the render method we retrive in this.props.children the ones that match the keys from the state, and we render these

Add support for 's component prop. It is the most common use case and it is now supported.

Add support for 's render prop. It is now going to fully support the react router v4 Route API.

TransitionSwitch no longer returns the underlying Route, but only what the Route element would render, meaning the child given to the Route via component, render, or children.