RIP21 / react-simplemde-editor

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

TypeError `_react.useMemo` is not a function #217

Open arnaskro opened 1 year ago

arnaskro commented 1 year ago

I've been trying to setup react-simplemde-editor but I keep running into the same issue

TypeError
(0 , _react.useMemo) is not a function

As you'll see in the example below, only things installed are react-simplemde-editor easymde react react-dom. Have I missed anything for the setup?

Code Sandbox example

RIP21 commented 1 year ago

Try using not 18.0.0 React version but whatever is latest version is. This can be a culprit of it all. I haven't checked the example as I'm from phone. But it's just a sophisticated guess.

arnaskro commented 1 year ago

I've tried with React 18.1.0 and 18.2.0 still the same result. Not sure what's going on.

Update: I've changed react-simplemde-editor version to 5.0.2 instead of 5.2.0 and it's working now.

RIP21 commented 1 year ago

@arnaskro funny thing is that it's still broken in the CodeSandbox example even tho it uses 5.2.0. But it uses Webpack, if I do exact code but Vite, it all works. So I guess it's still a problem of bundling to some extend, but maybe of Webpack rather than a bundler that I use. (which is tsup) either way. Will keep it open for some time.