react-codemirror2 icon indicating copy to clipboard operation
react-codemirror2 copied to clipboard

Is there any guide for integrating react-codemirror2 into NextJs?

Open igaimerca opened this issue 3 years ago • 2 comments

image

igaimerca avatar Aug 23 '22 16:08 igaimerca

Hi. We are getting this error when we try to integrate code mirror with nextjs. It works well with reactJs but not nextJs. Can you or someone else guide me and @igaimerca. Thanks in advance

mrraghur avatar Aug 25 '22 19:08 mrraghur

Import it dynamically with the ssr option set to false as navigator is not available on the server side.

import dynamic from 'next/dynamic';

const CM = dynamic(() => import('path-to-package'), { ssr: false });

zignis avatar Dec 10 '22 04:12 zignis