All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
useHash
undefined error from missing prop on event
- Support for React 18
useHistory
usePath
- BREAKING:
navigate
now hasoptions
object instead of overloads - BREAKING:
useNavigate
uses updatednavigate
params - BREAKING:
useLocationChange
now invokes the setter with aRavigerLocation
object instead of thepath
string
usePath
getting an old path ifnavigate
was called during the initial render
__tag
to the PopState events dispatched bynavigate
- BREAKING:
usePath
returnsdecodeURIComponent
-ed path - BREAKING:
useRoutes
,useMatch
, andusePathParams
match paths that have beendecodeURIComponent
-ed (e.g./weird (route)
will match a path of/weird%20(route)
) - BREAKING: type
RouteParams
renamed toRoutes
- BREAKING:
usePathParams
return type now depends on the input params. When a string it returns just the props, when an array it returns[path, props]
RouterProvider
useRoutes
function-values to use props typestring
(wasany
)
useMatch
hookusePathParams
hook
<Link basePath='/'>
not skipping contextbasePath
- terser mangling
location
in querystring methods
- Updated transpilation to reduce size, remove Babel
<ActiveLink>
matching in nested contexts<ActiveLink>
matching for relative paths
src/
to typescript- types are now natively generated from source and provided as declaration files
- Minimum NodeJS version is now 12
useRoutes
not updating after an internal<Redirect />
updates the location
- Rollup build to
keep_fnames
to retain component name checking
navigate
support for urls with different origins (external navigation)
- Sourcemaps to published package
useNavigationPrompt
now restores scroll position after undoing navigation
useNavigationPrompt
now intercepts browser back/forward button navigation
- Added support for React@17 in
peerDependencies
options.onInitial
parameter foruseLocationChange
that controls the first render behavior.default: false
.
useLocationChange
invoking the setter on initial render. This was not intended and was an unannounced change from the v1 behavior, so reverting it is not considered an API change but a bugfix.
state
parameter fornavigate
engine
requirement for 'less than' Node 15
- BREAKING:
useRoutes
andusePath
will returnnull
ifbasePath
is provided and missing from path - BREAKING:
useLocationChange
will invoke callback withnull
ifbasePath
is provided and missing from path - BREAKING:
useLocationChange
optioninheritBasePath
now accepts any false value (previously requiredfalse
with===
) - BREAKING:
useRoutes
optionmatchTrailingSlash
default totrue
(wasfalse
) - BREAKING: removed
linkRef
prop fromLink
andActiveLink
, replaced with standard ReactforwardRef
- BREAKING:
useQueryParams
setter second argument changed fromreplace
to options param withreplace
property - BREAKING:
useRedirect
parameters changed to match properties onRedirect
component
useFullPath
for getting the full path, ignoring any context-providedbasePath
- Support for Node 14
- Rollup-plugin-terser for builds
- Support for Node 8
useNavigate
hook
matchTrailingSlash
not matching on the root route/
query
prop to<Redirect>
useRoutes
path tracking withusePath
causing improper child invocations
navigate
handling ofreplace
in edge cases forreplaceOrQuery
basePath
matches not using case-insensitive like route paths
useQueryParam
using a?
when no query is set- typescript declaration for
useNavigationPrompt
useRoutes
error when changing the number of routes
usePath
setsinheritBasePath: false
when using providedbasePath
<Redirect>
ComponentuseHash
hook
<Link basePath>
prop override.
- double decoding on
useQueryParams
- Internal React-Context setup, reduces wasteful re-renders
replace: false
onsetQueryParams
replacinglocation.hash
linkRef
prop to<Link>
useLocationChange
: similar to useusePopState
, but uses different parameters
usePopState
hook
useNavigationPrompt
for confirming navigation changes
<Link target="_blank" />
triggering local navigation
<ActiveLink />
useRoutes
optionmatchTrailingSlash
- typescript declarations
useRoutes
second parameter frombasePath
tooptions
useRoutes
optionrouteProps
useRoutes
optionoverridePathParams
useBasePath
hook to retrieve the basePath
<Link>
cmd key detection
navigate
checksurl
param
useRedirect
adding null query
- Rollup dist output
useRedirect
hook
navigate(url, queryStringObj)
overload
- rollup output for module and cjs