flow

bởi facebook

Kiểm tra kiểu tĩnh cho mã React trên các nền tảng DOM và native. Bốn tùy chọn renderer bao gồm DOM tiêu chuẩn, mã dành riêng cho trình duyệt, React Native và môi trường Fabric. Chạy yarn flow với đối số renderer tùy chọn; sử dụng yarn flow-ci để kiểm tra toàn diện nhưng chậm hơn. Báo cáo lỗi kiểu kèm vị trí tệp để giúp xác định và sửa lỗi nhanh chóng. Cẩn thận với các lỗi thường gặp: thiếu chỉ định renderer, các khai báo $FlowFixMe chưa được kiểm tra và import kiểu không chính xác.

npx skills add https://github.com/facebook/react --skill flow

Flow Type Checking

Arguments:

  • $ARGUMENTS: Renderer to check (default: dom-node)

Renderers

RendererWhen to Use
dom-nodeDefault, recommended for most changes
dom-browserBrowser-specific DOM code
nativeReact Native
fabricReact Native Fabric

Instructions

  1. Run yarn flow $ARGUMENTS (use dom-node if no argument)
  2. Report type errors with file locations
  3. For comprehensive checking (slow), use yarn flow-ci

Common Mistakes

  • Running without a renderer - Always specify or use default dom-node
  • Ignoring suppressions - Check if $FlowFixMe comments are masking real issues
  • Missing type imports - Ensure types are imported from the correct package

Thêm skills từ facebook

api-health
facebook
Monitor API health for a Meta app — check rate limits, call volume, and API deprecations. Use to diagnose throttling, plan capacity, or prepare for API version…
official
api-integration
facebook
Guide a developer through setting up a Meta API integration from scratch — discovers the right APIs, fetches setup guides, authentication requirements,…
official
app-review-prep
facebook
Prepare a Meta app for App Review — checks current status, outstanding requirements, granted privileges, and submission history. Use before submitting an app…
official
debug-webhooks
facebook
Troubleshoot webhook issues for a Meta app — inspect active subscriptions, identify misconfiguration, and send test payloads to verify delivery. Use when…
official
webhook-setup
facebook
Set up webhooks for a Meta app end-to-end — discover available topics, subscribe to fields, and verify with a test payload. Use when configuring webhooks for…
official
buck2-rule-basics
facebook
Guide users through writing their first Buck2 rule to learn fundamental concepts including rules, actions, targets, configurations, analysis, and select(). Use…
official
add-ir-instruction
facebook
Hướng dẫn thêm một chỉ thị IR mới vào trình biên dịch Hermes. Sử dụng khi người dùng yêu cầu thêm, tạo hoặc định nghĩa một chỉ thị IR mới (Inst/Instruction) trong…
official
binary-size-analysis
facebook
This skill should be used when the user wants to analyze hermesvm binary size changes across a range of commits. Use when the user mentions "binary size",…
official