From e1d6d0eada4f7b9e4a243ba6ad97f2df019c3603 Mon Sep 17 00:00:00 2001 From: Mike Vitousek Date: Sat, 7 Sep 2024 17:49:43 -0700 Subject: [PATCH] [compiler] Fix issue where second argument of all functions was considered to be a ref ghstack-source-id: bd5f7b9f39063149db82898e8417736b7597c5f0 Pull Request resolved: https://github.com/facebook/react/pull/30912 --- .../babel-plugin-react-compiler/src/TypeInference/InferTypes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts b/compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts index b460124ec7..25bc87838a 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/TypeInference/InferTypes.ts @@ -107,7 +107,7 @@ function equation(left: Type, right: Type): TypeEquation { function* generate( func: HIRFunction, ): Generator { - if (func.env.fnType === 'Component') { + if (func.fnType === 'Component') { const [props, ref] = func.params; if (props && props.kind === 'Identifier') { yield equation(props.identifier.type, {