Plans for React 18?

Hey all - as always, so grateful for this community. I was wondering if the newly released React 18 RC has landed on the Meteor Core team’s brains and/or timelines at all? Given their philosophical “opt-in” approach, I imagine the transition may not be too painful.

Do you see anything required to change in Meteor for this update? I run through the article and everything looks similar to the upgrade from 16.x to 17.x which didn’t require any special handling from Meteor

Hi - no I haven’t seen anything yet that would warrant special handling, thanks for cross checking the article.

I have tried it with rc.1 (not with rc.2 so far), but it did not work for me, but that might be probably to things not related to Meteor. I’m currently implementing 2 new features so I haven’t had time to give it another try yet, but hopefully sometime this month I will get an opportunity to give it another try and get to the bottom of this.
If you encounter any issues, please contribute to this issue:

1 Like

We run our E2E tests using React 18.rc2 and everything passed. Seems like it did function like React 17 without using the new APIs.

The bigger question now is how the new SSR apis + Suspense + Concurrency works together with Meteor SSR

2 Likes

I just tried to upgrade my app from React 17 to 18, also believing that the change should be minimal. However, after upgrading to 18, subscriptions did not work as expected, they show flashing content and my loading spinner never stops. Also, hot reloading causes the app to crash.

Probably related to hooks being called twice in strict mode. Have you tried running your app with strict mode turned off?

1 Like

Up to now, I did not even know that this strict mode existed. I am not using it at the moment. Just using react-meteor-data (class-based model using withTracker HOC) for retrieving real-time data, so no hooks being used for Meteor connectivity either.