RIP21 / react-simplemde-editor

React wrapper for simplemde (easymde) markdown editor
https://react-simplemde-edtior.netlify.com/
MIT License
770 stars 103 forks source link

TypeError: _this.simpleMde.codemirror is undefined #157

Closed A7U closed 3 years ago

A7U commented 3 years ago

I'm not sure why, but this keeps happening.

import SimpleMDEReact from "react-simplemde-editor";
import "easymde/dist/easymde.min.css";

export default function MK() {
    return(<SimpleMDEReact/>)
}

I'm on NextJS but it's a framework on top of react, so it should work with nextjs too right?

RIP21 commented 3 years ago

I wouldn't recommend rendering SimpleMDEReact in the SSR environment, it makes no sense. You should guard it with some isSsr boolean so it renders on the client only.

Here are examples. https://github.com/RIP21/react-simplemde-editor/issues/148 https://github.com/RIP21/react-simplemde-editor/issues/89 https://github.com/RIP21/react-simplemde-editor/issues/73