problem description
question about how to write react components?
the environmental background of the problems and what methods you have tried
whether stateless components need to write return. When I see other people"s code without return, I report an error
https://www.cnblogs.com/SamWe.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
export const Home = () = > {
return (
<div>
<h1></h1>
<nav>
<Link to="/about"></Link>
<Link to="/events"></Link>
<Link to="/products"></Link>
<Link to="/contact"></Link>
</nav>
</div>
)
}
=
other people"s way of writing (without return)
export const Home = () = > {
<div>
<h1></h1>
<nav>
<Link to="/about"></Link>
<Link to="/events"></Link>
<Link to="/products"></Link>
<Link to="/contact"></Link>
</nav>
</div>
}
what result do you expect? What is the error message actually seen?
with or without it?