Skip to content

Update Auth Kit from v1 to v2

What's changed

  • React Auth Kit v2 comes with the support of React Router v6.
  • React Auth Kit v2 stops using the PrivateRoute component.
  • React Auth Kit v2 introduces new component named RequireAuth.
  • RequireAuth will replace the use-cases of PrivateRoute. It also will make the process easier to manage.

Update to v2

Component structure in v1

    <Route path={'/'} component={Home} exact/>
    <Route path={'/login' } component={Login} exact/>
    <PrivateRoute path={'/secure'}
                  loginPath={'/login'} exact

Component structure in v2

    <Route path={'/'} element={<Home/>}/>
    <Route path={'/login' } element={<Login/>}/>
    <Route path={'/secure'} element={
        <RequireAuth loginPath={'/login'}>

— 🔑 —

React Auth Kit is Apache 2.0 License code