From the course: Building a Website with Laravel, React.js, and Inertia

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Creating website navigation

Creating website navigation

- [Instructor] In the previous lesson, we created a home and about pages, but we won't be able to see these pages in the browser just yet because the website is being served from the App.jsx file, and we need to update this file first. Let's add a simple navigation to navigate between pages and finally see them in the browser. To create a navigation, we will need to install a library called react-router-dom. Let's run npm install react-router-dom in the terminal. Once that is done, let's see the upload.jsx file and delete everything that we don't need. We won't need the React and Vite logos, so let's delete the imports. We won't even need to use state in this file, so let's delete it too, and actually let's delete everything in the body of the component between the fragments. We will need to create a navigation component that we will include in this file. Let's create a directory called components, and in there, navigation.jsx. This component will be responsible for rendering the…

Contents