Skip to content

Commit

Permalink
[flow] Do not special case ref prop for non-component-type in jsx
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Nov 12, 2024
1 parent 259c9b1 commit 510a71e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typing/react_kit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 510a71e

Please sign in to comment.