Skip to content

Example project about how to use optional chaining with React

License

Notifications You must be signed in to change notification settings

ARautio/optional-chaining-post

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Example project about how to use optional chaining with React

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published