mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* react-breadcrumbs: update to version 2.1 * react-breadcrumbs: remove previous author Previous author asked to remove his name because he doesn't use the type and cannot review future changes
37 lines
943 B
TypeScript
37 lines
943 B
TypeScript
import * as React from "react";
|
|
import { Breadcrumbs, Breadcrumb } from "react-breadcrumbs";
|
|
|
|
class Wrapper extends React.Component {
|
|
render() {
|
|
return <div>{this.props.children}</div>;
|
|
}
|
|
}
|
|
|
|
function FunctionWrapper(props: { children?: React.ReactNode }) {
|
|
return <div>{props.children}</div>;
|
|
}
|
|
|
|
class MyComponent extends React.Component {
|
|
render() {
|
|
return (
|
|
<div>
|
|
<Breadcrumbs
|
|
className="demo__crumbs"
|
|
hidden
|
|
setCrumbs={crumbs => null}
|
|
wrapper={Wrapper}
|
|
/>
|
|
|
|
<Breadcrumbs
|
|
className="demo__crumbs"
|
|
wrapper={FunctionWrapper}
|
|
/>
|
|
|
|
<Breadcrumb data={{ title: "Dashboard", pathname: "/" }} />
|
|
|
|
<Breadcrumb data={{ pathname: "/dashboard" }} hidden />
|
|
</div>
|
|
);
|
|
}
|
|
}
|