Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 1.67 KB

v6.0.0.md

File metadata and controls

21 lines (13 loc) · 1.67 KB

v6.0.0 Migration Guide

This version introduces support for Node versions of ^14.19.0 || ^16.14.0. Many of the underlying dependencies used to build lp-components have also been updated. This version also eliminates support for earlier Node releases that are no longer considered under "long-term support" by the Node.js team. This version is compatible with Client template version ^6.0.0.

As part of updating underlying dependencies, a very old version of react-router was removed from this library. This involved removing the following components: <AuthorizedRoute />, <UnauthorizedRoute />, and <NavLink />. The authorization routes relied on an API that has been deprecated since version 4 of react-router. Likewise, the NavLink component exists natively in react-router v5 and subsequently does not require the custom wrapper that this library provided.

If your application relied on the NavLink component, simply use the NavLink from react-router and apply the active class of is-active.

// Before
import { NavLink } from 'lp-components'

<NavLink to="/">Home</NavLink>

// After
import { NavLink } from 'react-router'

<NavLink to="/" activeClassName="is-active">Home</NavLink>

If you need to implement authorized routes, follow the official example provided by react-router here: https://v5.reactrouter.com/web/example/auth-workflow. Alternatively, you can pull in the previous <AuthorizedRoute /> and <UnauthorizedRoute /> components locally from v5 of this library if the application that you're working on intends to stay on react-router@3.