Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

no routes matched location / react router

<Routes>
  <Route path="/" element={<GuestLayout />}>   // <-- layout wraps children routes
    <Route path="login" element={<Login />} /> // <-- "/login"

    // Optional index route if no nested routes match
    <Route
      index                                    // <-- "/"
      element={<div>Default Page Content</div>}
    />
  </Route>
</Routes>
Never look this up again
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #routes #matched #location #react #router
ADD COMMENT
Topic
Name
2+3 =