React Router DOM

(https://reactrouter.com/en/6.9.0/)

use Tailwind CSS

(https://tailwindcss.com/docs/guides/create-react-app)

create react router npm i react-router-dom

(https://www.npmjs.com/package/react-router-dom)

React Router

  1. BrowserRouter add in index.js and inside it replace App.
  2. Route write inside the Routes in the App.js
  3. Write attribute likes path and element in the route.
  4. Write extra Route for unknown direction its path is *.
  5. Link use Instead a tag. for custom Link use NavLink.

use

  1. For button click use useNavigate func. its alternative is Link.
  2. useParams use for getting dynamic value or key.
  3. Outlet should be used in parent route elements to render their child route elements.

Top categories

tailwind logo

Need a Tailwind website built?

Hire a professional TailwindCSS developer today.
Loading Svelte Themes