Implement container adding

This commit is contained in:
Siklos 2022-07-31 18:55:36 +02:00
parent 70963ce41f
commit 6c029ac13c
2 changed files with 32 additions and 10 deletions

View file

@ -11,12 +11,18 @@ interface IContainerProps {
}
export class Container extends React.Component<IContainerProps> {
public render(): React.ReactNode {
const containersElements = this.props.children.map(child => child.render());
public static ContainerCount = 0;
componentWillUnMount() {
}
public render(): React.ReactNode {
Container.ContainerCount++;
const containersElements = this.props.children.map(child => child.render());
return (
<g
transform={`translate(${this.props.x}, ${this.props.y})`}
key={`container-${Container.ContainerCount}`}
>
<rect
width={this.props.width}