reactjsnext.jsecmascript-2020

How to use ES2020 features in a Next.js app


I've been trying to use ES2020 features like optional chaining feature in next.js but it needs to a new loader, how do I fix this?


Solution

  • Just run

    npm install --save-dev @babel/plugin-proposal-optional-chaining