react-run-code
react-run-code copied to clipboard
Dynamic import required with SSR, not necessary
When monacoEditor.tsx imports ConsoleLog it causes error "document not defined". In the version of this package that is not on npm (the npm component grew out of a component from a NextJS project) this is solved with using a dynamic import via "next/dynamic".
I tried some hacks to make this work a while ago, not sure what the solution is. I had some wacky if(window){const ConsoleLog = require("./ConsoleLog")} or something like that, but TSDX didn't like it and maybe it just wasn't a good way of doing things.