Demo of components with children and other props
This commit is contained in:
parent
43afae5d77
commit
dcd9879d8d
2 changed files with 60 additions and 0 deletions
24
frontend/src/Containers/ContainerDemo.tsx
Normal file
24
frontend/src/Containers/ContainerDemo.tsx
Normal 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>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue