Fix type check + moved width and height to rect property

This commit is contained in:
Siklos 2022-08-01 19:42:28 +02:00
parent 6ac76f6619
commit 05622c3a64
3 changed files with 8 additions and 5 deletions

View file

@ -82,7 +82,7 @@ class App extends React.Component<IAppProps> {
} as IAppProps);
}
public OnPropertyChange(key: string, value: string) {
public OnPropertyChange(key: string, value: string | number) {
if (this.state.SelectedContainer === null ||
this.state.SelectedContainer === undefined) {
throw new Error('Property was changed before selecting a Container');
@ -93,7 +93,7 @@ class App extends React.Component<IAppProps> {
throw new Error('Property was changed before the main container was added');
}
const pair = {} as Record<string, string>;
const pair = {} as Record<string, string | number>;
pair[key] = value;
const properties = Object.assign(this.state.SelectedContainer.props.properties, pair);
const props = {