I’m using Vite with react, and I would like to show in the browser a imported function by ./Components/Navbar.jsx
.
To do this, I created the following script in App.jsx
:
import { Nav } from "./Componentes/Navbar";
function App() {
return (
<>
<Nav />
</>
)
}
The code with the function (Navbar.jsx
) is here:
import React from "react";
function Nav() {
<>
<h1>Navbar goes here</h1>
</>
}
export default Nav()
But the code doesn’t show anything in the browser. Someone could help me?
2
Answers
Your function Nav isn’t returning anything. Also the return is wrong.