Skip to content

Commit

Permalink
[flow] Drop experimental prefix for partial ref as prop support
Browse files Browse the repository at this point in the history
Summary:
React 19 is released. The partial support implementation hasn't changed for a while so let's announce it.

Changelog: [feature] Support for React 19's ref-as-prop model is now available via `react.ref_as_prop=partial_support`, and this is now the default. (To disable it, use `react.ref_as_prop=disabled`.) Under this mode, ref prop in jsx will be treated as a regular prop for function components, but utility types like `React.ElementConfig<...>` still won't include the regular ref prop yet.

Reviewed By: panagosg7

Differential Revision: D66831536

fbshipit-source-id: 7dc00943a8da947276273dd942b7512fd6ac447b
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Dec 5, 2024
1 parent 3204c02 commit 7738181
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/commands/config/flowConfig.ml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ module Opts = struct
node_resolver_root_relative_dirnames = [""];
pattern_matching_expressions = None;
react_custom_jsx_typing = false;
react_ref_as_prop = Options.ReactRefAsProp.Disabled;
react_ref_as_prop = Options.ReactRefAsProp.PartialSupport;
react_runtime = Options.ReactRuntimeClassic;
recursion_limit = 10000;
relay_integration = false;
Expand Down Expand Up @@ -1132,6 +1132,7 @@ module Opts = struct
[
("disabled", Options.ReactRefAsProp.Disabled);
("experimental.partial_support", Options.ReactRefAsProp.PartialSupport);
("partial_support", Options.ReactRefAsProp.PartialSupport);
]
(fun opts react_ref_as_prop -> Ok { opts with react_ref_as_prop })
);
Expand Down
1 change: 1 addition & 0 deletions tests/component_syntax/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ experimental.react_rule=deepReadOnlyProps
experimental.react_rule=rulesOfHooks
all=true
no_flowlib=false
react.ref_as_prop=disabled

[lints]
nested-component=error
Expand Down
1 change: 1 addition & 0 deletions tests/component_type/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
component_syntax=true
all=true
no_flowlib=false
react.ref_as_prop=disabled

[lints]
internal-type=off
2 changes: 1 addition & 1 deletion tests/react_ref_as_prop/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
all=true
no_flowlib=false
react.runtime=automatic
react.ref_as_prop=experimental.partial_support
react.ref_as_prop=partial_support

0 comments on commit 7738181

Please sign in to comment.