-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React PPX v4 no longer drops leading underscore from prop name #5908
Comments
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 ( 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}
/>
} |
Changelog 1964938 |
@shulhi That would be a good workaround without |
Another option is to use |
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.
The text was updated successfully, but these errors were encountered: