Skip to content

Commit

Permalink
tweakg
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jun 10, 2024
1 parent a6c9229 commit e7d89ae
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/ReasonReactErrorBoundary.re
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@ type componentPrototype;
[@mel.get]
external componentPrototype: reactComponentClass => componentPrototype =
"prototype";
[@mel.set] external setPrototype: (_, _) => unit = "prototype";

[@ocaml.warning "-21"]
let errorBoundary =
[@mel.this]
(
(self, _props) => (
{
componentCall(component, self);
self##state #= {"error": Js.undefined};
}: unit
)
(self, _props) => {
componentCall(component, self);
self##state #= {"error": Js.undefined};
}
);

[@mel.set] external setPrototype: (_, _) => unit = "prototype";
setPrototype(errorBoundary, objCreate(componentPrototype(component)));

[@mel.set] [@mel.scope "prototype"]
Expand Down

0 comments on commit e7d89ae

Please sign in to comment.