Optional Chaining

Optional chaining could be really useful and I tried to use this guide to set it up but couldn’t make it work with my Expo project. Did anyone succeed in setting it up correctly in an expo project?

I initialized a new project, wrote yarn add babel-plugin-transform-optional-chaining, then added transform-optional-chaining to babel.config.js, ran expo start, added an example to App.js and it worked as expected

1 Like

Thanks Brent,

It seems that it doesn’t work yet on RN 0.55 (I was using Expo SDK 30 here still). On another project, on which we just upgraded to RN 0.58, it seems to work by default, even without the extra babel plugin.

Wijnand

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.