S
SolidJS•12mo ago
lucy

"comp is not a function" or "class constructors must be invoked with 'new'"

Tried to embed: https://www.npmjs.com/package/react-image-crop using it via:
import {ReactCrop} from 'react-image-crop'
<ReactCrop>...</ReactCrop>
import {ReactCrop} from 'react-image-crop'
<ReactCrop>...</ReactCrop>
throws a class constructors must be invoked with 'new' trying:
const Cropper = new ReactCrop();
<Cropper>...</Cropper>
const Cropper = new ReactCrop();
<Cropper>...</Cropper>
throws a comp is not a function is there any way to make this work? thanks
5 Replies
REEEEE
REEEEE•12mo ago
That is a react library. It won't be compatible with Solid.
lucy
lucyOP•12mo ago
is there no stub of sorts either? all libraries basically become useless if they are react?
REEEEE
REEEEE•12mo ago
There might be that something that I'm not aware of, but afaik yes. Solid and React have different rendering methods.
lucy
lucyOP•12mo ago
explains it then at least, thanks 😄 I love all what solid offers, but this cuts down the ecosystem to vanilla js wrappers
lxsmnsyc
lxsmnsyc•12mo ago
Solid isn't really a React replacement anyways
Want results from more Discord servers?
Add your server