visx icon indicating copy to clipboard operation
visx copied to clipboard

Unable to compile Zoom

Open sadudani opened this issue 4 years ago • 3 comments

I'm getting the following error. I'm just using the provided example demo- zoomIssue zoom-i

JSX element class does not support attributes because it does not have a 'props' property.ts(2607) 'Zoom' cannot be used as a JSX component. Its instance type 'Zoom' is not a valid JSX element. Type 'Zoom' is missing the following properties from type 'ElementClass': context, setState, forceUpdate, props, refsts(2786) (alias) class Zoom import Zoom

sadudani avatar Jul 21 '21 14:07 sadudani

Hey @sadudani 👋 thanks for checking out visx. Just to verify, you are importing Zoom via the named import import { Zoom } from '@visx/zoom'; not the default import import Zoom from '@visx/zoom';?

If that doesn't work I'd guess there is some type of TS config error but that's hard to debug without a sandbox of your env, and the codesandbox of zoom-i works just fine.

williaster avatar Jul 21 '21 20:07 williaster

We are tring to reproduce the zoom-i example. We are using import { Zoom } from '@visx/zoom'; The tsconfig file is also compatible as the zoom-i. What do you think could be the issue?

sadudani avatar Jul 22 '21 14:07 sadudani

Sorry, it's going to be difficult to debug this unless you can fully reproduce it in a codesandbox since it clearly works in our demo codesandbox. Your app could have any number of issues.

williaster avatar Jul 22 '21 19:07 williaster

Closing for now. Happy to reopen with more information or if someone else encounters this.

hshoff avatar Mar 23 '24 14:03 hshoff