Hi. I am updating my React, Typescript, Babylonjs setup and with the latest versions I am encountering some issues.
Specifically regarding react-babylonjs package, which I usually use for some basic starting setup, and I’ve been using it the same way across multiple projects so far. But now I encounter this issue.
arcRotateCamera and hemisphericLight does not exist on type “JSX.IntrinsicElements”
Not sure what’s this about and how to go about it. I can completely ditch react-babylonjs and go with alternative setup but I really like using it, and would like to continue to do so.
hi @nogalo - thanks for bringing up the issue. I saw somebody did a fork with React 19, but only the deps. Maybe they came across similar issue.
that looks like a small change - i can drop that in no worries. i’m just heading on a flight to Vegas - not back till late Sunday. I can see on Monday, if my brain is operational.
I tried updating the namespaces but unfortunately it’s not enough. looks like there are changes to reconciler API so custom reconciler stuff should get updated as well. I’ll check some more to see if i can get it working
hi - yes. Welcome to the forum @barisozcetin i’m just seeing that today the changes are not as easy and cannot be backwards compatible. will need to bump library to v4 - lots of breaking changes in React 19 - even the new reconciler as you mentioned. I don’t know if you want to share where you landed - we could work on a PR together if you like. Cheers.
I got it working with primitive elements but asset manager fails if i try to load an external model. I made fork and pushed my changes to here if you want to take a look: GitHub - barisozcetin/react-babylonjs at react19
most of the changes are in ReactBabylonJSHostConfig file. i tried to add the new methods required for react-reconciler but i’m not really familiar with so my changes are mostly try and fail based. there are new fields related to suspend and i wasn’t sure how to handle those. Also they got rid of forwardRef in react 19 now, and Model component uses forwardRef. that’s one other issue that needs to be solved. That might be the reason why i couldn’t load the external model.
I’ll let you know if i can figure out anything else. If it’s helpful i can definitely help making a pr
thanks - that’s a good start. i see you upgraded the reconciler to 0.31. I’ll look through the host config differences - there’s definitely some parts of the system expecting the host elements to be created in a certain order - that hopefully didn’t change! i’m really busy this week with work, but will see how it goes and will try to look. looks like a great start though. cheers.
hi @barisozcetin - maybe it’s easier if you make a PR with your fork? i was going to fork your fork and then realized not sure how that works, since it’s originally from my repo? I think I will maintain a <= 18 version on 3.x and 19 on 4.x.
I have to think if it’s a good time to introduce other breaking changes. I’ve been wanting to build a declarative XR - waiting on apple, but it’s just getting silly waiting on apple and the VR examples are obsolete.
The type definitions and documentation for react-reconciler 0.31 doesn’t match so it can be tricky to work on that part. For example looks like they removed updatePayload from commitUpdate function but type definition is not updated