typescriptcreate-react-appnull-coalescing

How to configure CRA with TS to support nullish-coalescing-operator


So i started a new CRA project and I'm using the TS beta to get some sweet features like the chaining operator, but i also want to use nullish-coalescing-operator ifExists ?? elseUseThis

Unfortunately it didn't work out of the box and told me to install the babel plugin, but after adding it to .babelrc, it still didn't work.

Is there no way to add this support in Create React App?


Solution

  • Thanks Tweini for the answer for older version before 3.3.0.

    For newer versions of CRA [incuding if you update your react scripts], this feature is supported!

    https://github.com/facebook/create-react-app/releases/tag/v3.3.0