--- :white_check_mark: Resolved --- Hi all What’s...
# javascript
s
--- Resolved --- Hi all What’s the difference between
kotlin-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:
Copy code
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 it
t
Do you use IR?
s
Yes, I think LEGACY is deprecated above Kotlin 1.8.0.. no?
Update: If I roll back to
pre.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
?
t
s
Update: This is what worked for me on the latest wrapper version right now (i.e. pre.529)
Copy code
val 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