Demo of components with children and other props

This commit is contained in:
Imbus 2024-03-06 11:14:57 +01:00
parent 43afae5d77
commit dcd9879d8d
2 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import { ReactNode } from "react";
/** The props for the container */
interface ContainerProps {
children: ReactNode;
}
/**
* Contains children
* @param props - The children to contain
* @returns {JSX.Element} The container
*/
export function Container(props: ContainerProps): JSX.Element {
return <div>{props.children}</div>;
}
/**
* Contains even more children
* @param props
* @returns {JSX.Element}
*/
export function Container2(props: ContainerProps): JSX.Element {
return <Container>{props.children}</Container>;
}