Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## master

- Nothing yet
- Rewrite the `RescriptReactErrorBoundary` component implementation with `@react.component`, so it can be compatible with the changes of JSX PPX.

## v0.10.3

Expand All @@ -26,12 +26,14 @@ For history on previous evolution of the code, check out the original [reason-re
- **IMPORTANT:** Currently, old third-party packages that are still dependent on `reason-react` will not mix with other `@rescript/react` based code due to a build system problem. Which means that every third-party dependency needs to be upgraded to `@rescript/react` first to make it compatible. See [this forum discussion](https://forum.rescript-lang.org/t/discussion-reason-react-rescript-react-migration-path/1086) for more details.

- Removed legacy modules ("record api"):

- `ReasonReactCompat`
- `ReactDOMServerRe`
- `ReactEventRe`
- `ReasonReactOptimizedCreateClass`

- Renamed existing modules:

- `ReasonReactErrorBoundary` -> `RescriptReactErrorBoundary`
- `ReasonReactRouter` -> `RescriptReactRouter`
- (Note: Usually the two only valid styles would be `ReScript` or `rescript`, the latter being the version for technical writing. We are using `Rescript` here, since it is essentially the capitalized version of `rescript`)
Expand Down
14 changes: 4 additions & 10 deletions src/RescriptReactErrorBoundary.res
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type params<'error> = {
info: info,
}

let getErrorBoundary = %raw(`
let getErrorBoundary: reactComponentClass => React.element = %raw(`
function (Component) {
function ErrorBoundary(props) {
Component.call(this);
Expand All @@ -31,12 +31,6 @@ let getErrorBoundary = %raw(`
}
`)

@obj
external makeProps: (
~children: React.element,
~fallback: params<'error> => React.element,
~key: string=?,
unit,
) => {"children": React.element, "fallback": params<'error> => React.element} = ""

let make = getErrorBoundary(component)
@react.component
let make = (~children as _: React.element, ~fallback as _: params<'error> => React.element) =>
getErrorBoundary(component)