SHARE
TWEET

Untitled

a guest Jan 21st, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // what it is:
  2. let ProtectedRoute = (props) => {
  3.   return (
  4.     isAuthenticated ?
  5.       <ToDos {...props} /> :
  6.       <div>Not auth!</div>
  7.   )
  8. }
  9.  
  10. // what I want:
  11. let ProtectedRoute = (props) => {
  12.   return (
  13.     isAuthenticated ?
  14.       <props.component {...props} /> :
  15.       <div>Not auth!</div>
  16.   )
  17. }
  18.  
  19. <ProtectedRoute component="ToDo" path="/todo" />
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top