🚸 Routing in the box
Co-authored-by: Amalie Erdal Mansåker <amalie.erdal.mansaker@nav.no> Co-authored-by: Øydis Kind Refsum <oydis.kind.refsum@nav.no>
This commit is contained in:
parent
eabfd2b291
commit
73215513a3
4 changed files with 25 additions and 6 deletions
|
@ -1,10 +1,23 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import { RouterProvider, createBrowserRouter } from 'react-router-dom'
|
||||
import './index.css'
|
||||
import Home from './index.tsx'
|
||||
import Home from './index'
|
||||
import Feil from './pages/feil'
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <Home />,
|
||||
},
|
||||
{
|
||||
path: "nyfeil",
|
||||
element: <Feil />
|
||||
}
|
||||
])
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<Home />
|
||||
<RouterProvider router={router} />
|
||||
</React.StrictMode>,
|
||||
)
|
||||
|
|
Reference in a new issue