Using react-fusioncharts in a Remix.run app doesn't seem to work? Any workarounds?
ReactFC.fcRoot(FusionCharts, Column2D, GammelTheme)
I'm getting this error:
ReferenceError: document is not defined
It makes sense since Remix use SSR, but even if I use this safe guard it fails (recommended approach from Remix docs):
if (typeof document !== 'undefined') {
ReactFC.fcRoot(FusionCharts, Column2D, GammelTheme)
}
The component needs to be wrapped inside a
ClientOnlycomponent fromremix-utils. This way, the component will render only on the client and will not be server-rendered.