Skip to content

Commit f63c2a8

Browse files
committed
Revert "use jsx ppx for error boundary comp"
This reverts commit 08efa90.
1 parent 7bb5424 commit f63c2a8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/RescriptReactErrorBoundary.res

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type params<'error> = {
1414
info: info,
1515
}
1616

17-
let getErrorBoundary: reactComponentClass => React.element = %raw(`
17+
let getErrorBoundary = %raw(`
1818
function (Component) {
1919
function ErrorBoundary(props) {
2020
Component.call(this);
@@ -31,6 +31,12 @@ let getErrorBoundary: reactComponentClass => React.element = %raw(`
3131
}
3232
`)
3333

34-
@react.component
35-
let make = (~children as _: React.element, ~fallback as _: params<'error> => React.element) =>
36-
getErrorBoundary(component)
34+
@obj
35+
external makeProps: (
36+
~children: React.element,
37+
~fallback: params<'error> => React.element,
38+
~key: string=?,
39+
unit,
40+
) => {"children": React.element, "fallback": params<'error> => React.element} = ""
41+
42+
let make = getErrorBoundary(component)

0 commit comments

Comments
 (0)