react-json-view-compare
react-json-view-compare copied to clipboard
Bug with next.js
Hello,
First of all thanks for the amazing diff tool! I wanted to report a little bug when using next.js:
The error comes from the index.js in the lib folder; however, it's encrypted and not easy to fix on my own, so I was wondering if there could be support for SSR in a future release?
Thank you!
Thank you for your advice. I'll support it later
you can try this way:
import dynamic from 'next/dynamic';
const DynamicReactCompare = dynamic(() => import('react-json-view-compare'), {
ssr: false,
});
and notice your react and reac-dom version,this is my package.json file in project:
"dependencies": {
"next": "10.0.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-json-view-compare": "^1.0.0"
}
it's works.
I'm aware dynamic loading can be done, but wanted to inform you in case that you would like to address this out of the box for SSR users :)
Haha. Okay.