From e7d89aef85e423bb29b7bc4bcc939e192a642aa6 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 9 Jun 2024 23:35:14 -0700 Subject: [PATCH] tweakg --- src/ReasonReactErrorBoundary.re | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/ReasonReactErrorBoundary.re b/src/ReasonReactErrorBoundary.re index 36847fd3f..9318df682 100644 --- a/src/ReasonReactErrorBoundary.re +++ b/src/ReasonReactErrorBoundary.re @@ -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"]