tiny, flexible, hook for rendering route breadcrumbs with react-router v6
MIT License
Bot releases are hidden (Show)
Published by icd2k3 about 2 years ago
react-router
to react-router-dom
instead. (Fixes #59)The original reason for requiring react-router
is because it is compatible with both web and react-native, so this hook now (as of version 4.0.0) only supports web. If there is enough interest, we can spin up another hook specifically for react-native.
Published by icd2k3 over 2 years ago
Route
that extends react-router
's for Typescript convenience when using dynamic routes. (#46) (thanks @MichaelDimmitt)Published by icd2k3 over 2 years ago
<Route \>
component) routes #46 (thanks @MichaelDimmitt)Published by icd2k3 over 2 years ago
-
with
. For example, a URL with "some-route"
would now render a default breadcrumb of "Some route"
instead of "Some-route"
#42 (thanks @codytooker)defaultFormatter
for users to provide their own function to generate default breadcrumbs (string) => string
#42 (thanks @codytooker)Published by icd2k3 almost 3 years ago
Published by icd2k3 almost 3 years ago
Published by icd2k3 almost 3 years ago
react-router 6
. #31 (huge thanks to @Grapedge for the refactor)Version >=3 only supports react-router 6... if you are still using react-router 5 please continue to use v2.0.2
Published by icd2k3 over 3 years ago
Published by icd2k3 over 3 years ago
Published by icd2k3 almost 4 years ago
props
option in route config for passing properties through to the breadcrumb components. Previously, we were passing through all additional props on the route object, by moving it to an explicit props
option we can avoid property conflicts and have better types support.This will not be a breaking change unless you are already including extra props in your route objects.
For example:
const routes = [{
path: '/path',
breadcrumb: ({ extraProp }) => <span>{extraProp}</span>,
props: { extraProp: 'extra' }, // optional extra pass-through props for breadcrumb components
}]
useBreadcrumbs(routes)
Published by icd2k3 almost 4 years ago
null
for breadcrumb
(#12)Published by icd2k3 over 4 years ago
Published by icd2k3 over 4 years ago
site.com/sandwiches//tuna
)Published by icd2k3 over 4 years ago
Published by icd2k3 over 4 years ago
react-router-dom
as a peer dependency