skip to Main Content

Javascript – useParams Returns Undefined values

I'm using react-router-dom 5.2.0 App.jsx `<Route path="/shop"> <ProductListPage /> </Route> <Route path="/shop/:page"> <ProductListPage /> </Route> <Route path="/shop/:gender/:category?"> <ProductListPage /> </Route> <Route path="/shop/:filter"> <ProductListPage /> </Route>` ProductListPage.jsx `import { useParams } from "react-router-dom"; export default function ProductListPage() { let { page…

VIEW QUESTION

Reactjs – Reusing the BrowserRouter Route in another component

I have BrowserRouter in my header.js file: <BrowserRouter> <header className='tren dark:bg-blend-multiply h-[25vh] grid grid-cols-12 shadow-xl '> <div className='flex items-center justify-center col-span-full md:justify-end md:pr-10'> <div className='flex flex-row justify-between w-full px-4 md:block md:w-fit'> <h1 className='text-center text-white underline decoration-wavy decoration-2 '> Dit Gestion…

VIEW QUESTION
Back To Top
Search