-
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
Fix support for recursive components in JSX V4. #5986
Conversation
@mununki feel free to take over from here. (compiler 10.1 etc). |
1dd7a75
to
b4d70de
Compare
Oh! Thanks! |
I found one thing missing. The What do you think? |
Wondering why the test failed. I ran |
That is breakage, not a fix. Consider the test: module Rec = {
@react.component
let rec make = () => {
mm(({}: props))
}
and mm = (x) => make(x)
} You can't remove the toplevel There is some little annoyance, already present in V3, that if you only have |
8ad9e03
to
b4d70de
Compare
That is correct. It is not applicable except the example calling |
Perhaps the warning can be addressed by turning this: let rec make = {
let rec \"make$Internal" = (_: props) => make(({}: props))
}
and make = {
let \"V4$Rec" = props => \"make$Internal"(props)
\"V4$Rec"
}
make
}
} into this (remove let rec make = {
let \"make$Internal" = (_: props) => make(({}: props))
let make = {
let \"V4$Rec" = props => \"make$Internal"(props)
\"V4$Rec"
}
make
}
} |
The unused ref flag is not away in the example from the issue: module Rec1 = {
type props = {}
let rec make = {
@merlin.focus
let \"make$Internal" = (_: props) => {
React.null
}
let make = {
let \"V4$Rec1" = props => \"make$Internal"(props)
\"V4$Rec1"
}
make
}
} |
Oh, that is correct warning |
I think that's the desired transform, which gives a warning only when it is a correct one. |
How does it look? rescript-lang/syntax@92a7736 |
Looking good |
Fixes #5981