Looking at this React Router Dom v4 example https://reacttraining.com/react-router/web/example/auth-workflow I see that PrivateRoute component destructures a rest prop like this
const PrivateRoute = ({ component: Component, ...rest }) => (
<Route {...rest} render={props => (
fakeAuth.isAuthenticated ? (
<Component {...props}/>
) : (
<Redirect to={{
pathname: '/login',
state: { from: props.location }
}}/>
)
)}/>
)
I want to be certain that { component: Component, ...rest }
means:
From
props
, get the Component prop and then all other props are given to you, and renameprops
torest
so you can avoid naming issues with the props passed to the Routerender
function
Am I right?