Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
React 16 Tooling

You're reading from  React 16 Tooling

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788835015
Pages 298 pages
Edition 1st Edition
Languages
Authors (2):
Adam Boduch Adam Boduch
Profile icon Adam Boduch
Christopher Pitt Christopher Pitt
Profile icon Christopher Pitt
View More author details

Table of Contents (18) Chapters

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Creating a Personalized React Development Ecosystem 2. Efficiently Bootstrapping React Applications with Create React App 3. Development Mode and Mastering Hot Reloading 4. Optimizing Test-Driven React Development 5. Streamlining Development and Refactoring with Type-Safe React Components 6. Enforcing Code Quality to Improve Maintainability 7. Isolating Components with Storybook 8. Debugging Components in the Browser 9. Instrumenting Application State with Redux 10. Building and Deploying Static React Sites with Gatsby 11. Building and Deploying React Applications with Docker Containers 1. Another Book You May Enjoy Index

Installing and initializing Flow


Before you can start implementing type-safe React components, you need to install and initialize Flow. I'll show you how this is done with a create-react-app environment, but the same steps can be followed for almost any React environment.

You can install Flow globally, but I would recommend installing it locally, along with all the other packages that your project depends on. Unless there's a good reason to install something globally, install it locally. This way, anyone installing your application can get every dependency by running npm install.

To install Flow locally, run the following command:

npm install flow-bin --save-dev

This will install the Flow executable locally to your project and will update your package.json so that Flow is installed as a dependency of your project. Now let's add a new command to package.json so that you can run the Flow type checker against your source code. Make the scripts section look like this:

"scripts": { 
  "start": "react...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}