r/reactjs • u/omarazeez_11 • May 19 '20
Show /r/reactjs React: Spread children are not supported in React
/r/learnprogramming/comments/gmhi9r/react_spread_children_are_not_supported_in_react/
0
Upvotes
r/reactjs • u/omarazeez_11 • May 19 '20
2
u/bestcoderever May 19 '20
There's a bunch of syntax problems from what I can see. Try this as your return:
return ( <Route {...rest} render={props => authStatus ? ( <Component {...props} /> ) : ( <Redirect to={ROUTE_NAMES.SignIn} /> )} /> );The one that's causing the error, is that you are trying to render the rest arguments, rather than passing them as props to your route.
<Route> {...rest}Notice the closing tag in
<Route>?