Adding Login and Authentication Sections to your React or React Native app
Scott Luptowski

The EnsureLoggedInContainer example does not work in react-router 4.1.1

Having both a component property and children within the route means only the component from the property is rendered, and the children are ignored. The following warning is emitted with the code example:

“Warning: You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored”

this.props.children is undefined in EnsureLoggedInContainer, and react-router does not propagate them through.

The example is interesting in concept, but it doesn’t work for latest react-router.

Show your support

Clapping shows how much you appreciated Logan McGrath’s story.