Lesson 3 - Create NavBar.jsx Component
/*NavBar.jsx -- before SearchBar component */
/** @format **/
function NavBar() {
return (
<>
<nav className="navbar bg-body-tertiary">
<div className="container-fluid">
<a className="navbar-brand" href="#">
<img
className=" col-md-3 "
src="../src/assets/react.svg"
alt="BookShelf Logo"
width="30"
height="24"
/>
Google Book Shelf
</a>
</div>
</nav>
</>
)
}
export default NavBarExplanation of NavBar.jsx Code Structure
NavBar.jsx Code Structure1. Importing Libraries
2. Component Declaration
3. Local State for Search Input
4. Handling Form Submission
5. Rendering the Navbar
6. Prop Validation
7. Exporting the Component
Key Takeaways for Students:
Last updated