icd2k3 / use-react-router-breadcrumbs

tiny, flexible, hook for rendering route breadcrumbs with react-router v6
https://stackblitz.com/edit/github-fiw8uj?file=src/App.tsx
MIT License
261 stars 23 forks source link

fix: typescript compiler for dynamic routing solution #51

Closed MichaelDimmitt closed 2 years ago

MichaelDimmitt commented 2 years ago

adds breadcrumb to the Route type from react router

Note:

There may be a simpler way to add Type BreadCrumb to the type Route using an intersection: but this is what I could get working.

I do not know how to update just the param of a function type in typescript.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 8c1235585bbaad41b8cbe432993e8355854e6c87 on MichaelDimmitt:fix-typescript-for-dynamic-routing into a5a3188977b5daedb3c5c843c87f28ada62a7c63 on icd2k3:master.

MichaelDimmitt commented 2 years ago

@YousefED @icd2k3 , any thoughts on this solution?

anything you want changed. thanks!

icd2k3 commented 2 years ago

Sorry @MichaelDimmitt - been a busy week - I'll look into this tomorrow, thank you!

icd2k3 commented 2 years ago

This makes sense to me - and if anyone would prefer to import Route directly from react-router instead they can always make their own type for it.