title: How to resolve eslint error: "prop spreading is forbidden" in a custom route component?
body: <p>How can I resolve the eslint error: &quot;prop spreading is forbidden&quot; in a custom route component?</p>
  <p>This error occurs on lines 3 and 6 below:</p>
  <pre><code>const PrivateRoute = ({component: Component, ...rest}) =&gt; (
    &lt;Route
      {...rest}
      render={(props) =&gt; (
          localStorage.getItem('user') ?
            &lt;Component {...props} /&gt; :
            &lt;Redirect to={{pathname: '/login', state: {from: props.location}}} /&gt;
    )}
    /&gt;
  );
  </code></pre>