react-form-builder
react-form-builder copied to clipboard
Nextjs: window is not defined
Issue #183 has resurfaced.
I tried to looking at the diff for v0.11.1 to see if I could figure out the fix. It didn't jump out at me.
For now I'm having to do this to work around:
// Question Editor:
import dynamic from "next/dynamic";
const ReactFormBuilder = dynamic(() => import("react-form-builder2").then((module) => module.ReactFormBuilder), {
ssr: false,
});
// Question Display
import dynamic from "next/dynamic";
const ReactFormGenerator = dynamic(() => import("react-form-builder2").then((module) => module.ReactFormGenerator), {
ssr: false,
});
Hello @richardpickett , if the issue is still there, can you please assign it to me ??