Closed as not planned
Description
π Search Terms
"getBoundingClientRect"
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
No response
π» Code
onClick: (event: MouseEvent): void => {
const { left, top } = event.target.getBoundingClientRect();
const { left, top } = event.nativeEvent.target.getBoundingClientRect();
},
π Actual behavior
Hi.
I've found that I can't use getBoundingClientRect with MouseEvent in typescript.
onClick: (event: MouseEvent): void => {
const { left, top } = event.target.getBoundingClientRect();
const { left, top } = event.nativeEvent.target.getBoundingClientRect();
},
Typescript message I see in VS code is:
Property 'getBoundingClientRect' does not exist on type 'EventTarget'.ts(2339)
π Expected behavior
No typescript message