Thanks to everyone for your efforts to help me before at How to pass and retrieve data over the url in React I don't know why it wasn't working but I decided to simplify things and just pass a string instead of an object but it still isn't being read. Instead of having a dynamic url, it just passes the string ":i" or ":book.id" or whatever value I try to use in the Link tag.
App.js
<Router>
<div className="App">
<Header />
<Switch>
<Route path="/" component={Main} />
<Route path='/:i' component={Single} />
</Switch>
</div>
</Router>
Main.js
const Main = () => {
return (
<div id="main">
{data.map((book, i) => {
return (
<div key={i} className="squares">
<img
src={images[book.picture]}
className="covers"
alt="book cover"
/>
<h3>
///////////////////////!!! HERE !!!/////////////////////////////////////
**<Link to="/:i">{book.title}</Link>**
</h3>
Book.js
const Book = (props) => {
let id = useParams();
console.log("1", id); ////logs ':i'