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

What to use instead of InjectedProps #113

Closed
abemedia opened this issue Jul 5, 2020 · 3 comments · Fixed by #115
Closed

What to use instead of InjectedProps #113

abemedia opened this issue Jul 5, 2020 · 3 comments · Fixed by #115
Labels
types issues with TS or Flow defs

Comments

@abemedia
Copy link

abemedia commented Jul 5, 2020

The last version saw the TS definition for InjectedProps get removed. What are we meant to use instead?

@asherccohen
Copy link

Any idea how this can be fixed?
Breadcrumbs assume a React.ReactNode[] but with no further type definition of breadcrumbs.

Any help?

@icd2k3
Copy link
Owner

icd2k3 commented Dec 21, 2020

Hello @abemedia @asherccohen 👋 . I switched from manually defining types to having them generated for the package (when I switched the src code from js to ts, this is probably when we switched off of InjectedProps). The current definition for a breadcrumbs route is:

export interface BreadcrumbsRoute {
    path: string;
    breadcrumb?: React.ComponentType | React.ElementType | string;
    matchOptions?: MatchOptions;
    routes?: BreadcrumbsRoute[];
}

Where breadcrumb is an optional component/element/string.

Is this missing something? Let me know and I'm happy to adjust or accept a PR!

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

icd2k3 commented Dec 21, 2020

oh, is this related to being able to pass extra props as part of the route object?

routes = [{
  path: '/path',
  breadcrumb: ({ extra }) => <span>{extra}</span>,
  extra: 'extra',
}]

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

Successfully merging a pull request may close this issue.

3 participants