react-simplemde-editor icon indicating copy to clipboard operation
react-simplemde-editor copied to clipboard

TypeError `_react.useMemo` is not a function

Open arnaskro opened this issue 3 years ago • 3 comments

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

arnaskro avatar Dec 06 '22 15:12 arnaskro

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.

RIP21 avatar Dec 06 '22 16:12 RIP21

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.

arnaskro avatar Dec 06 '22 16:12 arnaskro

@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.

RIP21 avatar Dec 07 '22 20:12 RIP21