So I'm using PrivateRoute in React to serve some components. Everything's been working fine until I specified the exact path like below:
<PrivateRoute exact path="/info/:id" render={(props) => <BookInfo {...props} />} />
The above path works fine if I serve it normally using Route but routing though PrivateRoute gives me the following error.

PrivateRoute.js
import React from 'react'
import { Route, Redirect } from 'react-router-dom';
import { connect } from 'react-redux';
const PrivateRoute = ({ component: Component, auth, ...rest}) => (
<Route {...rest} render={ props =>
auth.isAuthenticated === true ?
(<Component {...props}/>) : (<Redirect to ='/login'/>)}/>
)
const mapStateToProps = state => ({
auth: state.auth
})
export default connect (mapStateToProps)(PrivateRoute);
I don't know what's causing this, some help is much appreciated.