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

React 19? #3

Open
natew opened this issue Feb 8, 2025 · 3 comments · May be fixed by #4
Open

React 19? #3

natew opened this issue Feb 8, 2025 · 3 comments · May be fixed by #4

Comments

@natew
Copy link

natew commented Feb 8, 2025

Probably annoying to support but we've moved to it and I'm getting this:

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
                                             ^

TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')
    at $$$reconciler (/Users/n8/one/node_modules/react-reconciler/cjs/react-reconciler.development.js:491:46)
    at sources/react/Reconciler.ts (/Users/n8/one/node_modules/terminosaurus/dist/react.js:11107:54)
    at __init (/Users/n8/one/node_modules/terminosaurus/dist/react.js:9:56)
@natew
Copy link
Author

natew commented Feb 8, 2025

Looks like react-pdf bridged it in a nice way here:

https://github.com/diegomura/react-pdf/tree/master/packages/reconciler/src

@arcanis
Copy link
Owner

arcanis commented Feb 17, 2025

I made an attempt (#4) but it seems to break a fairly simple test case, so I'm not sure what to make of it considering the React team hasn't published any migration guide for reconciler authors 😕

@CodyJasonBennett
Copy link

prepareUpdate was removed, and the update payload in commitUpdate as well. This is likely causing the breakage. You can see the shell types I implemented in react-three-fiber as a reference: https://github.com/pmndrs/react-three-fiber/blob/master/packages/fiber/src/core/reconciler.tsx#L71, and a very simple example: https://github.com/pmndrs/react-nil. If you want to support both, I would do feature detection to switch between the old/new commitUpdate signatures. Types can be breaking though. Make sure you access or augment JSX in module scope (it was global scope before), and you can support the latest 18+ and 19+ types. I've opted against this as reconciler behavior is very different from 18-19, and there are inherent bugs we need to combat and deviate as a result.

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

Successfully merging a pull request may close this issue.

3 participants