react-tradingview-widget
react-tradingview-widget copied to clipboard
Next.js, silently fails on page refresh.
I am facing an issue while using with Next.js. It silently fails to load on page refresh but whenever a change is made, hot reload happens, the chart is rendered.
It's happening because of chart container not present in DOM at the time when the script is loaded.
any solution ?
You want to render your component holding the widget like so:
const DynamicHomeWithNoSSR = dynamic(() => import('./MyWidget'), { ssr: false });
const MyWidget = DynamicHomeWithNoSSR;