Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // what it is:
- let ProtectedRoute = (props) => {
- return (
- isAuthenticated ?
- <ToDos {...props} /> :
- <div>Not auth!</div>
- )
- }
- // what I want:
- let ProtectedRoute = (props) => {
- return (
- isAuthenticated ?
- <props.component {...props} /> :
- <div>Not auth!</div>
- )
- }
- <ProtectedRoute component="ToDo" path="/todo" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement