Skip to content

Commit

Permalink
Use act from 'react' inseat of react-dom/test-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
davesnx committed Nov 18, 2024
1 parent 16090ac commit e6fdb2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ReactDOMTestUtils.re
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type undefined = Js.undefined(unit);

let undefined: undefined = Js.Undefined.empty;

[@mel.module "react-dom/test-utils"]
[@mel.module "react"]
external reactAct: ((. unit) => undefined) => unit = "act";

let act: (unit => unit) => unit =
Expand All @@ -15,7 +15,7 @@ let act: (unit => unit) => unit =
reactAct(reactFunc);
};

[@mel.module "react-dom/test-utils"]
[@mel.module "react"]
external reactActAsync: ((. unit) => Js.Promise.t('a)) => Js.Promise.t(unit) =
"act";

Expand Down
5 changes: 4 additions & 1 deletion test/Form__test.re
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ module Thread = {
ReactDOM.createElement(
"form",
~props=ReactDOM.domProps(~ref=ReactDOM.Ref.domRef(formRef), ()),
[||],
[|
<input type_="text" name="message" placeholder="Hola!" />,
<button type_="submit"> {React.string("Enviar")} </button>,
|],
),
{"action": formAction},
)}
Expand Down

0 comments on commit e6fdb2e

Please sign in to comment.