Skip to content

Commit

Permalink
Move formStatus into ReactDOM
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Nov 18, 2024
1 parent 2190bb9 commit e3a97dd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
12 changes: 0 additions & 12 deletions src/React.re
Original file line number Diff line number Diff line change
Expand Up @@ -902,16 +902,4 @@ module Experimental = {
('state, ('state, 'optimisticValue) => 'state) =>
('state, 'optimisticValue => unit) =
"useOptimistic";

type formStatus = {
pending: bool,
data: FormData.t,
[@mel.as "method"]
method_: [ | `get | `post],
action: Js.Nullable.t(unit => unit),
};

/* https://react.dev/reference/react-dom/hooks/useFormStatus#use-form-status */
[@mel.module "react"]
external useFormStatus: unit => formStatus = "useFormStatus";
};
12 changes: 0 additions & 12 deletions src/React.rei
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,6 @@ module Experimental: {
external useTransitionAsync:
unit => (bool, callbackAsync(callbackAsync(unit, unit), unit)) =
"useTransition";

type formStatus = {
pending: bool,
data: FormData.t,
[@mel.as "method"]
method_: [ | `get | `post],
action: Js.Nullable.t(unit => unit),
};

/* https://react.dev/reference/react-dom/hooks/useFormStatus#use-form-status */
[@mel.module "react"]
external useFormStatus: unit => formStatus = "useFormStatus";
};

[@mel.set]
Expand Down
14 changes: 14 additions & 0 deletions src/ReactDOM.re
Original file line number Diff line number Diff line change
Expand Up @@ -1593,3 +1593,17 @@ external jsxs: (string, domProps) => React.element = "jsxs";
[@mel.module "react/jsx-runtime"]
external jsxsKeyed: (string, domProps, ~key: string=?, unit) => React.element =
"jsxs";

module Experimental = {
type formStatus = {
pending: bool,
data: FormData.t,
[@mel.as "method"]
method_: [ | `get | `post],
action: Js.Nullable.t(unit => unit),
};

/* https://react.dev/reference/react-dom/hooks/useFormStatus#use-form-status */
[@mel.module "react"]
external useFormStatus: unit => formStatus = "useFormStatus";
};
14 changes: 14 additions & 0 deletions src/ReactDOM.rei
Original file line number Diff line number Diff line change
Expand Up @@ -1594,3 +1594,17 @@ external jsxs: (string, domProps) => React.element = "jsxs";
[@mel.module "react/jsx-runtime"]
external jsxsKeyed: (string, domProps, ~key: string=?, unit) => React.element =
"jsxs";

module Experimental: {
type formStatus = {
pending: bool,
data: FormData.t,
[@mel.as "method"]
method_: [ | `get | `post],
action: Js.Nullable.t(unit => unit),
};

/* https://react.dev/reference/react-dom/hooks/useFormStatus#use-form-status */
[@mel.module "react"]
external useFormStatus: unit => formStatus = "useFormStatus";
};

0 comments on commit e3a97dd

Please sign in to comment.