Children
export const Button = () => {
return (
<button type="button" className="btn btn-primary">
Primary
</button>
);
};
Last updated
export const Button = () => {
return (
<button type="button" className="btn btn-primary">
Primary
</button>
);
};
Last updated
type Props = {
children: string;
};
export const PrimaryButton = ({ children }: Props) => {
return (
<button type="button" className="btn btn-primary">
{children}
</button>
);
};import { Breadcrumb } from "./components/BreadCrumb";
import { PrimaryButton } from "./components/Button";
...
<div>
<Breadcrumb items={items1} />
<Breadcrumb items={items2} />
<UserDetail />
<PrimaryButton>button1</PrimaryButton>
<PrimaryButton>button2</PrimaryButton>
</div>
);
};
...<PrimaryButton>button<span>1</span></PrimaryButton>import { ReactNode } from "react";
type Props = {
children: ReactNode;
};