palantir / blueprint

A React-based UI toolkit for the web
https://blueprintjs.com/
Apache License 2.0
20.68k stars 2.17k forks source link

<Breadcrumb> does not exist (error in docs) #3131

Closed shahzeb1 closed 5 years ago

shahzeb1 commented 5 years ago

Environment

Steps to reproduce

Refer to this link in the docs: https://blueprintjs.com/docs/#core/components/breadcrumbs.breadcrumbs

private renderCurrentBreadcrumb = ({ text, ...restProps }: IBreadcrumbProps) => {
        // customize rendering of last breadcrumb
        return <Breadcrumb {...restProps}>{text} <Icon icon="star" /></Breadcrumb>;
    };

There is no such thing as <Breadcrumb> and therefore, there is an error thrown.

Actual behavior

Error is thrown if the sample code is run. I'm not sure if the user is suppose to understand / define their own <Breadcrumb/> component.

Expected behavior

Unsure what should go there, but replacing <Breadcrumb>...</Breadcrumb> with <div>...</div> seems to fix things.

Possible solution

Please let me know what the correct fix to this will be and I'll go ahead and make a PR.

Thank you.

giladgray commented 5 years ago

@shahzeb1 add the import to the first line. this is an error in the docs code.


- const { Breadcrumbs, IBreadcrumbProps, Icon } = "@blueprintjs/core";
+ import { Breadcrumb, Breadcrumbs, IBreadcrumbProps, Icon } from "@blueprintjs/core";
petersobolev commented 5 years ago

Still not fixed (lack if import { Breadcrumb, .. } ) https://blueprintjs.com/docs/#core/components/breadcrumbs