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 – Url is changing but page is only appearing after reloading

import React from 'react'; import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import Onboarding from './components/Onboarding/Onboarding'; import Login from './components/Login/Login'; function App() { return ( <Router> <div className="flex justify-center w-[386px] h-[800px] mb-6 mt-5 ml-[35%] box-sizing:border-box rounded-sm overflow-auto -z-50">…

VIEW QUESTION
Back To Top
Search