Skip to content

kevinrobinson/flow-adts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blog post: Type checking state in React components with Flow

Flow is a static analysis tool for JavaScript. It lets you gradually add type annotations, and will check that you adhere to the type constraints you’ve added. I’ve never used this in production code, but here’s what I learned trying to use this to enforce constraints on a React component’s state. Specifically, I wanted to see if Flow would support encoding algebraic data types in JavaScript and help catch mistakes I made when using them

Read more...

Running locally

$ npm install
$ npm run-script build   # long-lived process to watch and build

# in another terminal:
$ flow check

If you're running this locally, I also see unrelated two type errors that I couldn't figure out. If you can help me figure these out that'd be awesome, but for the purposes of the blog post they're safe to ignore.

About

Blog post: Type checking state in React components with Flow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published