title: What does ...rest mean in React JSX?
body: <p>Looking at this React Router Dom v4 example <a href="https://reacttraining.com/react-router/web/example/auth-workflow" rel="noreferrer">https://reacttraining.com/react-router/web/example/auth-workflow</a> I see that <strong>PrivateRoute</strong> component destructures a rest prop like this</p>
  <pre><code>const PrivateRoute = ({ component: Component, ...rest }) =&gt; (
    &lt;Route {...rest} render={props =&gt; (
      fakeAuth.isAuthenticated ? (
        &lt;Component {...props}/&gt;
      ) : (
        &lt;Redirect to={{
          pathname: '/login',
          state: { from: props.location }
        }}/&gt;
      )
    )}/&gt;
  )
  </code></pre>
  <p>I want to be certain that <code>{ component: Component, ...rest }</code> means:</p>
  <blockquote>
  <p>From <code>props</code>, get the Component prop and then all other props are given to you, and rename <code>props</code> to <code>rest</code> so you can avoid naming issues with the props passed to the Route <code>render</code> function</p>
  </blockquote>
  <p>Am I right?</p>