tiny, flexible, HOC for rendering route breadcrumbs with react-router v4 & 5
MIT License
Published by icd2k3 over 5 years ago
withBreadcrumbs
now returns an array of Object
s instead of Component
s:
- breadcrumbs.map(breadcrumb)
+ breadcrumbs.map({ breadcrumb })
Within this object, other props like match
, location
, and pass-through props are also returned:
- breadcrumbs.map((breadcrumb) => {})
+ breadcrumbs.map(({ breadcrumb, match, location, someCustomProp }) => {})
You can read more about this change here
Published by icd2k3 over 5 years ago
Published by icd2k3 almost 6 years ago
Published by icd2k3 about 6 years ago
Published by icd2k3 over 6 years ago
Published by icd2k3 over 6 years ago
Published by icd2k3 over 6 years ago
Published by icd2k3 over 6 years ago
disableDefaults
(outlined in the readme)Published by icd2k3 over 6 years ago
Published by icd2k3 over 6 years ago
This release includes a few key changes to the package. If you're migrating from v1.x.x please check out the migration guide. I don't anticipate any more core changes to the API, but please let me know in the issues tab if there is a problem with this current implementation.
/one/two
--> Home / One / Two
(with no route config passed).[{ breadcrumb, path, /* ... */ }]
to the component using the HOC. We now just return a flat array of breadcrumb components with props included. This makes the rendering step a bit easier to read / use.options
object with an optional excludePaths
param to easily opt-out of generating breadcrumbs for certain pathswithBreadcrumbs
is now a default exportPublished by icd2k3 over 6 years ago
getBreadcrumbs
exported function instead of the HOC itself.Published by icd2k3 over 6 years ago
breadcrumb
to be present in route objects if it is not needed for that specific path.Published by icd2k3 almost 7 years ago
.mjs
export. Thanks @mhelmerPublished by icd2k3 almost 7 years ago
Uncaught TypeError: Cannot call a class as a function
Published by icd2k3 almost 7 years ago
Published by icd2k3 almost 7 years ago
Published by icd2k3 almost 7 years ago
"/"
route matching: https://github.com/icd2k3/react-router-breadcrumbs-hoc/issues/3