Skip to content

Latest commit

 

History

History
32 lines (17 loc) · 795 Bytes

README.md

File metadata and controls

32 lines (17 loc) · 795 Bytes

Optional chaining example with React

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.

The key parts

  • 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.

How to use

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