React Native: Why a component is not being rendered after a redirect?

Write application for RN and decided to connect the routing via react-router-native.

const state = {
 authStore: {
 isAuth: true,
}
};

const PrivateRoute = ({ component: Component, ...rest }) => (
 <route {...rest} render="{props" =>
 state.authStore.isAuth ? (
 <component {...props}>
 ) : (
 <redirect to="{{" pathname: 'login', state: { from: props.location }, }}>
)}
/>
);

<provider store="{store}">
<nativerouter>
<view>
<container>
 <route path="/registration" component="{Registration}">
 <route path="/login" component="{Login}">
 <privateroute path="/" component="{Masters}">
</privateroute></route></route></container>
</view>
</nativerouter>
 </provider></redirect></component></route>


The redirect occurs on /login, but the render of this component fails. If you run the Toggle Element Inspector, then everything is okay.

Tell me how to solve this problem? I don't want to alter routing to the other, I have a choice, but faced with such a problem and I do not understand how to solve for the second day.
June 14th 19 at 20:51
1 answer
June 14th 19 at 20:53
I at least see an undeclared variable state, there may be always undefined do you have?
no, with her it's OK, I just cut too much to show of ranting. - Mohamed.Funk commented on June 14th 19 at 20:56

Find more questions by tags Mobile developmentReact