scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.65k stars 192 forks source link

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

Open igaimerca opened 1 year ago

igaimerca commented 1 year ago

image

mrraghur commented 1 year ago

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

zignis commented 1 year ago

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 });