This repository shows a simple example how optional chaining can be set up when developing with React. We use babel and babel plugin for optional chaining to handle new syntax and parcelJS to simplify the build process. The same babel configuration would work with webpack too.
Note that after Babel 7.8.0 optional chaining has been part of the base package.
- Check .babelrc and package.json for required packages to handle optional chainging.
- Check App.jsx to see how optional chaining is used inside React application.
To run application
npm install
npm run dev
and open browser from http://localhost:1234
To build application
npm install
npm run build
And to test
npm install
npm run test