Closed Minnozz closed 1 month ago
I believe this is related to #5904, but maybe this change should be mentioned separately in the changelog.
I have the same issue, as a workaround, I did something like this – use an intermediate type as the prop (@as
) working fine here.
module FormattedMessage = {
module Internal = {
@react.component @module("react-intl")
external make: (
~id: string,
~defaultMessage: string,
~tagName: string=?,
~values: {..}=?,
~children: (~formattedMessage: React.element) => React.element=?,
) => React.element = "FormattedMessage"
}
type props<'a> = {
@as("id") id_: string,
defaultMessage: string,
tagName?: string,
values?: {..} as 'a,
}
let make = (props: props<'a>) =>
<Internal
id={props.id_}
defaultMessage={props.defaultMessage}
tagName=?{props.tagName}
values=?{props.values}
/>
}
@Minnozz Good catch! I've updated the changelog in the following PR #5905 Thank you for suggestion.
@shulhi That would be a good workaround without @react.component
until the PR is merged. Thanks!
Another option is to use ~\"type": ChartType.t
.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
In previous versions of ReScript / the React PPX, I used the following bindings:
The leading underscore from
~_type
was dropped to bind to the proptype
.In the new React PPX, this underscore is no longer dropped, which makes the binding not work.