Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"render" function throws "reactRender is not a function" with react 19-rc #550

Open
AngeloTallarita opened this issue Jun 14, 2024 · 10 comments

Comments

@AngeloTallarita
Copy link

AngeloTallarita commented Jun 14, 2024

Hi everyone, I'm currently working on a project testing the new release candidate version of react 19. I noticed that when calling the render function defined here it throws the error reactRender is not a function. It looks like createRoot is not found when used with react 19-RC and this leads to use the legacyRender that of course will not work.
I suspect there's some problem related on how createRoot it's imported, here the official reference from react where it's imported from react-dom/client and not from react-dom.
Thanks in advance for the support!

@deathemperor
Copy link

I can confirm the issue by patching react-dom/client and it works

diff --git a/es/React/render.js b/es/React/render.js
index 169f01b2998a21ba42fa7b7a397ee526ad2aacb4..62793f70ab5e9d9488800b8dd3a866c67a14a943 100644
--- a/es/React/render.js
+++ b/es/React/render.js
@@ -2,7 +2,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
 import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
 import _typeof from "@babel/runtime/helpers/esm/typeof";
 import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
-import * as ReactDOM from 'react-dom';
+import * as ReactDOM from 'react-dom/client';
 // Let compiler not to search module usage
 var fullClone = _objectSpread({}, ReactDOM);
 var version = fullClone.version,

@voltuer
Copy link

voltuer commented Aug 16, 2024

so is this going to be fixed?

@phamquocbuu
Copy link

I am waiting for a fix 😂

@lovewinders
Copy link

+1

@voltuer
Copy link

voltuer commented Oct 24, 2024

with the release of next 15 this has become annoying

@WuJiY
Copy link

WuJiY commented Nov 1, 2024

I am waiting for a fix 😂

me too

@infodusha
Copy link

@rendeyuwei you are actually wrong: there is a split before the Number call so that particular line works just fine.

@rendeyuwei
Copy link

@rendeyuwei you are actually wrong: there is a split before the Number call so that particular line works just fine.

Sorry, I made a simple mistake, but the error still exists.

@infodusha
Copy link

Yep, for me the patch to react-dom/client actually helps

@deathemperor
Copy link

@zombieJ can you please take a look? thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants