Open jordanlambrecht opened 2 years ago
AHA! Got it. Needs to be imported dynamically if you're using nextjs.
import dynamic from 'next/dynamic'
const ReactTwitchEmbedVideo = dynamic(() => import('react-twitch-embed-video'), {
ssr: false,
})
I'm going to leave this open and let you close it so you can see it and decide if you want to make mention in your docs about it
Makes sense that this would need a dynamic import since its dependent on the library being successfully being loaded on the page before it can work its mojo. I haven't worked with nextjs but if you have suggestions to adjust code to make it just work let me know. If I think I will add your code snippet to the readme as a usage recommendation.
Using typescript, function components, tailwind, and nextjs. Full error:
code:
Any ideas? The code is directly copy/pasted from the generator on Storybook