I'm trying to pass title
from props to my Dishes
component using <Link>
but can't find a solution. Any sugestions?
import { Link } from "react-router-dom";
const Category = ({ title }) => {
return (
<Link to="/dishes">
{title}
</Link>
);
};
export default Category;
App.js
is looking like this:
return (
<Router>
<div className="App">
<Route
path="/"
exact
render={(props) => (
<Categories recipes={recipes} />
)}
/>
<Route path="/dishes" component={Dishes} />
</div>
</Router>
);