excalidraw: Downgraded from React 18 back to 17 due to stability issues and problems with .updateScene calls.

Coinciding with the upgrade of Obsidian-Excalidraw to React 18 and migrating to ReactDOM.createRoot for creating the Excalidraw component I’ve been experiencing various random issues. Two in particular

  1. Excalidraw and/or Obsidian screen going blank on certain operations. One example is this bug: #738.
  2. Executing multiple updateScene() calls within a function results in updateScene calls to be dropped. I can trace back the point in time when it stopped working to the commit when I moved to .createRoot. #747

I have found that if I space .updateScene() calls by placing them in separate window.requestAnimationFrame() calls the updateScene() issue has gone away, however, the stability issue remained… or rather it could be that the stability issue is caused by requestAnimationFrame(), however without that I wasn’t able to overcome the issue mentioned in bullet 2.

For now, it seems the downgrade has resolved immediate problems, however, I’d like to understand if I am misusing the package in some way that is leading to the above issues, or if something needs to be changed in the Excalidraw package.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

It turns out that the issue I encountered in the afternoon was due to an error in the plugin code, not Excalidraw. I fixed the error, since then I’ve not experienced issues with React 18. I’ll continue to use this version of the plugin for few days. If still nothing, then I will close this issue.