From 510a71eb4783914ca392db3239e4c59c6f6bf30d Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Mon, 11 Nov 2024 16:36:36 -0800 Subject: [PATCH] [flow] Do not special case ref prop for non-component-type in jsx Summary: The effect is a few removed errors, since it will just make props, which now includes the ref prop, flow to any since prop types of a non-component is any. Changelog: [internal] Reviewed By: panagosg7 Differential Revision: D65694569 fbshipit-source-id: 60a1b5f904e6a722e9f5ae3810654b58ffae1b36 --- src/typing/react_kit.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typing/react_kit.ml b/src/typing/react_kit.ml index e95f274dc24..4678ecd747c 100644 --- a/src/typing/react_kit.ml +++ b/src/typing/react_kit.ml @@ -255,8 +255,7 @@ module Kit (Flow : Flow_common.S) : REACT = struct | Options.ReactRefAsProp.PartialSupport -> None) | DefT (_, ReactAbstractComponentT { instance = ComponentInstanceOmitted _; _ }) | DefT (_, StrT _) - | DefT (_, SingletonStrT _) - | _ -> + | DefT (_, SingletonStrT _) -> get_builtin_typeapp cx (update_desc_new_reason (fun desc -> RTypeAppImplicit desc) reason_ref) @@ -269,6 +268,7 @@ module Kit (Flow : Flow_common.S) : REACT = struct ); ] |> Option.some + | _ -> None let rec props_to_tout cx trace component ~use_op ~reason_op u tout = match drop_generic component with