[compiler] Fix issue where second argument of all functions was considered to be a ref
ghstack-source-id: 1817f3b816ab5ec013a3b1a6c8a8373a30e0b3a0 Pull Request resolved: https://github.com/facebook/react/pull/30912
Mike Vitousek committed
Sep 16, 2024 at 10:53 UTC
c8a7cab13f9d496d4b178ba5e95b030ca854aa20
1 file changed
+1
-1
compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts
+1
-1
@@ -107,7 +107,7 @@ function equation(left: Type, right: Type): TypeEquation {
107
function* generate(
108
func: HIRFunction,
109
): Generator<TypeEquation, void, undefined> {
110
- if (func.env.fnType === 'Component') {
110
+ if (func.fnType === 'Component') {
111
const [props, ref] = func.params;
112
if (props && props.kind === 'Identifier') {
113
yield equation(props.identifier.type, {