flow
Static type checking for React code across DOM and native platforms.
- Four renderer options cover standard DOM, browser-specific code, React Native, and Fabric environments
- Run
yarn flowwith optional renderer argument; useyarn flow-cifor comprehensive but slower checks - Reports type errors with file locations to help identify and fix issues quickly
- Watch for common pitfalls: missing renderer specification, unexamined
$FlowFixMesuppressions, and incorrect type imports
Flow Type Checking
Arguments:
- $ARGUMENTS: Renderer to check (default: dom-node)
Renderers
| Renderer | When to Use |
|---|---|
dom-node |
Default, recommended for most changes |
dom-browser |
Browser-specific DOM code |
native |
React Native |
fabric |
React Native Fabric |
Instructions
- Run
yarn flow $ARGUMENTS(usedom-nodeif no argument) - Report type errors with file locations
- For comprehensive checking (slow), use
yarn flow-ci
More from facebook/react
fix
Use when you have lint errors, formatting issues, or before committing code to ensure it passes CI.
1.7Kextract-errors
Use when adding new error messages to React, or seeing "unknown error code" warnings.
958verify
Use when you want to validate changes before committing, or when you need to check all React contribution requirements.
886test
Use when you need to run tests for React core. Supports source, www, stable, and experimental channels.
883feature-flags
Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.
846flags
Use when you need to check feature flag states, compare channels, or debug why a feature behaves differently across release channels.
783