Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling default generated breadcrumbs by passing breadcrumb: null raises an error #109

Closed
rwojnarowski opened this issue Jun 2, 2020 · 2 comments
Labels
types issues with TS or Flow defs

Comments

@rwojnarowski
Copy link

According to docs (option 2) https://github.com/icd2k3/react-router-breadcrumbs-hoc#disabling-default-generated-breadcrumbs im able to disable breadcrumb by passing somthing like this:
{ path: '/a/b', breadcrumb: null }. And it's works but typescript type checker raises an error/warning:

Argument of type '({ path: string; breadcrumb: string; } | { path: string; breadcrumb: null; })[]' is not assignable to parameter of type 'BreadcrumbsRoute[]'.
  Type '{ path: string; breadcrumb: string; } | { path: string; breadcrumb: null; }' is not assignable to type 'BreadcrumbsRoute'.
    Type '{ path: string; breadcrumb: null; }' is not assignable to type 'BreadcrumbsRoute'.
      Types of property 'breadcrumb' are incompatible.
        Type 'null' is not assignable to type 'string | ComponentClass<any, any> | FunctionComponent<any> | ComponentClass<{}, any> | FunctionComponent<{}> | undefined'

I can pass { path: '/a/b', breadcrumb: undefined } to silence the error but it will not disable /a/b route. Is there any workaround for this or BreadcrumbsRoute type definition needs some updates?

@icd2k3 icd2k3 added the types issues with TS or Flow defs label Jun 3, 2020
@icd2k3
Copy link
Owner

icd2k3 commented Jun 3, 2020

Thanks @rwojnarowski, I'm going to update how these types are generated soon

@icd2k3
Copy link
Owner

icd2k3 commented Jun 3, 2020

Should be fixed as of 3.3.0, let me know if there's still a problem!

@icd2k3 icd2k3 closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types issues with TS or Flow defs
Projects
None yet
Development

No branches or pull requests

2 participants