Checked the code and cannot find where I need to put a semicolon. Here is error. Here is the code.
Asked
Active
Viewed 968 times
-2
-
Please include any relevant information (that includes errors and code) in the question itself as text rather than images. That makes it easier for us to copy/paste your code into an editor to try to reproduce/fix the issue, and for others to find this question when they run into the same error message. – rickdenhaan Dec 08 '21 at 11:36
2 Answers
0
It should be like this
const PropsPage = () => { return ( <h3>Props Page</h3> );};
for a
const App = () => {
return (
<section className="App">
<Router>
...
<Link to="/404-not-found">404</Link>
<Link to="/props">Passing Props</Link> <Switch>
...
<Route exact path="/props" component={PropsPage} /> <Route component={NoMatchPage} />
</Switch>
</Router>
<a href="/about">about with browser reload</a>
</section>
);
};
Passing function as a component props in Route component
const PropsPage = ({ title }) => {
return (
<h3>{title}</h3>
);
};

kawaii-kitsune
- 19
- 4