mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Update Zod function schemas to use v4 API syntax: - Replace z.function().args(z.string()) with z.function(z.tuple([z.string()]), z.any()) - Update moduleTypeProvider and flowTypeProvider in Environment.ts - Allow both Zod v3 and v4 in package dependencies (^3.22.4 || ^4.0.0) This fixes the crash when users have Zod v4 installed, where the .args() method no longer exists. The new API is compatible with both Zod v3.23+ and v4.x. Fixes TypeError: zod.z.function(...).args is not a function
React Compiler
React Compiler is a compiler that optimizes React applications, ensuring that only the minimal parts of components and hooks will re-render when state changes. The compiler also validates that components and hooks follow the Rules of React.
More information about the design and architecture of the compiler are covered in the Design Goals.
More information about developing the compiler itself is covered in the Development Guide.