Как использовать SecureRoute с React Router v6
Я использую Asgradeo React ADK вместе с React Router v6. С React Router v5SecureRoute
работает отлично. Но для v6 это не так. Есть ли какой-либо другой API для React Router v6? Не нашел в документации API https://github.com/asgardeo/asgardeo-auth-react-sdk/blob/main/API.md#securing-routes-with-asgardeo .
<BrowserRouter>
<Routes>
<Route path="/" element={<LandingPage/>}/>
<SecureRoute path="/home" callback={()=>signIn()} component={HomePage}/>
</Routes>
</BrowserRouter>
Дайте следующую ошибку.
[Wi] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>
at invariant (http://localhost:3000/main.js:1993:11)
at http://localhost:3000/main.js:40020:108
at http://localhost:3000/main.js:42639:17
at http://localhost:3000/main.js:42602:17
at mapIntoArray (http://localhost:3000/main.js:42493:23)
at mapIntoArray (http://localhost:3000/main.js:42543:23)
at mapChildren (http://localhost:3000/main.js:42601:3)
at Object.forEachChildren [as forEach] (http://localhost:3000/main.js:42638:3)
at createRoutesFromChildren (http://localhost:3000/main.js:40005:47)
at Routes (http://localhost:3000/main.js:39848:20)
я использую@asgardeo/auth-react
- v2.0.3 вместе сreact-router-dom
- v6.3.0