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

undefined preview #197

Closed bencinterlink closed 2 years ago

bencinterlink commented 2 years ago

Using react 18.0.0 & react-simplemde-editor 5.0.2 and having an odd error where all I'm shown is undefined in the editor when I toggle to preview mode. Toggling the editor back to edit/normal mode brings back the writing I've put into the editor.

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

interface NewArticleProps {
  updatePageHeader: (header:string) => void
}

export default function NewArticle({updatePageHeader}:NewArticleProps) {

  return (
    <SimpleMDE />
  )
}

As you can see it's essentially a default install, tried placing the component at various levels to watch for any difference but have been unsuccessful. Also there are no errors reported in the browser/react console.

image image

bencinterlink commented 2 years ago

Update: Just discovered installing easymde@2.16.0 or earlier (as a peer dependency as instructed by README) doesn't result in this error so possibly either a conflict between recent version of easymde or an issue with easymde itself.

RIP21 commented 2 years ago

Hey. I'll plan to revisit this codebase to check how it works with react 18 etc in recent future and to update package version to include some recent fixes some people introduced.

Regarding issue, prob issues with easymde. Will double check that too.

dexkode4 commented 2 years ago

Update: Just discovered installing easymde@2.16.0 or earlier (as a peer dependency as instructed by README) doesn't result in this error so possibly either a conflict between recent version of easymde or an issue with easymde itself.

Thanks for tthis

jcwrightson commented 2 years ago

Same problem 😬

KristerL commented 2 years ago

The issue still persists

RIP21 commented 2 years ago

Checked with easymde@2.18.0 and I don't see any issues. It's also recommended to update to 5.1.0 not that it will fix something, but it may :)

Icarus-Xu commented 2 years ago

using easymde@2.18.0 & react-simplemde-editor@5.1.0 or @5.2.0, the problem persists @RIP21

solved by downgrading easymde to 2.16.0