Open af-arturoramirez opened 1 year ago
Hi! I have the same problem .... if someone managed to fix it and the solution it would be very cool thanks
Running into the same issue when using build scripts.
I'm suspecting it's to do with newer react
versions, personally I'm on v18.0.0 where the issue is happening.
as temporary fix for vite
import ReactFsLightbox from 'fslightbox-react';
const FsLightbox = ReactFsLightbox.default
? ReactFsLightbox.default
: ReactFsLightbox;
then use <FsLightbox />
as temporary fix for vite
import ReactFsLightbox from 'fslightbox-react'; const FsLightbox = ReactFsLightbox.default ? ReactFsLightbox.default : ReactFsLightbox;
then use
<FsLightbox />
Hi, I tried using and it works but I get this message on vscode and when I try to build it:
Property 'default' does not exist on type 'typeof FsLightbox'.
What can I do now?
When I run it locally (vite) it works as expected but once I deployed it to prod (using vercel) it is throwing this error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
<button type="button" onClick={() => setToggler(!toggler)}> Toggle Lightbox </button> <FsLightbox toggler={toggler} sources={[ "https://i.imgur.com/fsyrScY.jpg", "https://www.youtube.com/watch?v=3nQNiWdeH2Q", "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", ]} />