React 19 and ReScript

Hello everybody, I’m considering upgrading to React 19, I was wondering if anybody tried React 19 with ReScript and had any feedback about it. Are there still some blockers?

3 Likes

I haven’t used React 19 yet, but if anyone has experimented with the new React compiler, I would love to hear your experiences. I looked into this a while ago, and there were some limitations, so I’m eager to learn more if anyone has tried it recently.

1 Like

We did not get around yet to use it at work, except with our NextJS website which is TS only. But that is mainly because we always use the version that’s also shipped with React Native/Expo since almost all our apps have both a webapp and React Native app.

1 Like

FYI I’ve eventually taken the plunge and upgraded to React 19, everything worked perfectly out of the box straight away!

I haven’t started using React Compiler yet though.

5 Likes

React compiler it’s a babel plugin, so as long Rescript outputs the expected javascript shape, should be fine

1 Like

This is not the case today: Will the compiler support plain JSX function calls again? · reactwg/react-compiler · Discussion #22 · GitHub
The React compiler doesn’t kick in when the JSX is already transformed.

1 Like

Found a nifty diagram:

(Source: [Compiler Bug]: Compiler fails to memoize hooks with no hook calls · Issue #31727 · facebook/react · GitHub)
And it is kinda official, since that user is a Meta employee, AFAIK.

So if it stays like that, without a preserve mode only components with Hooks in them can be automatically optimized.

1 Like