Skip to content

Commit 08efa90

Browse files
committed
use jsx ppx for error boundary comp
1 parent ef32529 commit 08efa90

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/RescriptReactErrorBoundary.res

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

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

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)
34+
@react.component
35+
let make = (~children as _: React.element, ~fallback as _: params<'error> => React.element) =>
36+
getErrorBoundary(component)

0 commit comments

Comments
 (0)