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