Closed vadimshvetsov closed 2 years ago
yarn run pretty
Getting Uncaught TypeError: Cannot read properties of undefined (reading 'x') when using SelectionBox
Uncaught TypeError: Cannot read properties of undefined (reading 'x')
Closes https://github.com/projectstorm/react-diagrams/issues/867
Because SelectionBox code uses interface as class with instanceof. It's always false.
instanceof
false
Remove instanceof usage and rely on object props.
Checklist
yarn run pretty
What?
Getting
Uncaught TypeError: Cannot read properties of undefined (reading 'x')
when using SelectionBoxCloses https://github.com/projectstorm/react-diagrams/issues/867
Why?
Because SelectionBox code uses interface as class with
instanceof
. It's alwaysfalse
.How?
Remove
instanceof
usage and rely on object props.Feel good image: