Shubham Singh
04/04/2023, 6:18 AMkotlin-react-router
, kotlin-react-router-dom
, and kotlin-remix-run-router
?
Because I am using the latest version (i.e. 1.0.0-pre.529) and have included all these three dependencies but still can’t see any props inside the Route
component
I am expecting to write something like this:
BrowserRouter {
Routes {
Route {
path = "/",
element = VFC { +"Root Page" }
}
Route {
path = "/auth",
element = VFC { +"Auth Page" }
}
}
}
But there are no props inside the Route
component
Update - I can see that RouteProps extends react.Props
which has nothing but key
inside itturansky
04/04/2023, 8:55 AMShubham Singh
04/04/2023, 9:34 AMShubham Singh
04/04/2023, 10:35 AMpre.346
(the default version that comes when the project is initialised), everything starts working fine ✅
Now my query is only limited to knowing what is the new way to achieve the same result? What’s the new way of using BrowserRouter
?turansky
04/04/2023, 1:27 PMShubham Singh
04/05/2023, 2:38 AMval ptRouter = createBrowserRouter(routes = arrayOf(
jso {
path = PTRoutes.root
element = ProtectedRoute.create {
DashboardPage {}
jso<RouteObject> {
path = <http://PTRoutes.app|PTRoutes.app>
element = VFC { +"App Screen" }.create()
}
}
},
jso {
path = PTRoutes.auth
element = AuthenticationPage.create()
}
))
Please consider this query as resolved ✅