-
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
Add jsx ppx for attribute @react.componentWithProps
#7203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05
.
Benchmark suite | Current: 998282d | Previous: e1b7fb7 | Ratio |
---|---|---|---|
Print RedBlackTree.res - time/run |
2.5336877066666665 ms |
2.3104395133333333 ms |
1.10 |
Print RedBlackTreeNoComments.res - time/run |
2.3414450266666664 ms |
2.10057036 ms |
1.11 |
Print Napkinscript.res - time/run |
81.58969135333332 ms |
77.00100409999999 ms |
1.06 |
Print HeroGraphic.res - time/run |
9.61578382 ms |
8.775952553333333 ms |
1.10 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks a lot! Could you add a CHANGELOG entry?
Sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
Does it also work for bindings? Old syntax: @module("react-konva") @jsx.component(: props)
external make: props => Jsx.element = "Rect" JsxRuntime.jsx(ReactKonva.Rect, {
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height,
fill: "black"
}, key); New syntax (doesn't work): @module("react-konva") @jsx.componentWithProps
external make: props => Jsx.element = "Rect" JsxRuntime.jsx(prim => ReactKonva.Rect(prim), {
x: rect.x,
y: rect.y,
width: rect.width,
height: rect.height,
fill: "black"
}, key); |
Oh, I think we need to add the syntax error for BTW, the old one seems the proper binding for your case. |
So no chance to get it also working for external bindings? Asking just for consistency. |
This PR introduces a new
@react.componentWithProps
attribute that explicitly handles the props with shared props: