Skip to content
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 JSX V4 build error when component props have the default value with same name #6377

Merged
merged 5 commits into from
Aug 30, 2023

Conversation

mununki
Copy link
Member

@mununki mununki commented Aug 29, 2023

Fixes #6374 #6375

  • build error when the prop has default value with same name
module C2 = {
  let a = "foo"
  @react.component
  let make = (~a=a) => React.string(a) // build error
}
  • build error when prop has default value and type annotation
module C3 = {
  @react.component
  let make = (~disabled as everythingDisabled: bool=false) => {
    React.string(everythingDisabled ? "true" : "false")
  }
}

@cristianoc
Copy link
Collaborator

@DZakh does this work for you?

@mununki would you do __foo instead of foo__

@mununki
Copy link
Member Author

mununki commented Aug 30, 2023

@mununki would you do __foo instead of foo__

Sure, f8e7e70

@mununki mununki linked an issue Aug 30, 2023 that may be closed by this pull request
@DZakh
Copy link
Contributor

DZakh commented Aug 30, 2023

Yep, looks good. Thanks for a quick fix 🫶

Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge away

@mununki mununki merged commit c43223f into master Aug 30, 2023
14 checks passed
@mununki mununki deleted the fix-jsx-default-value branch August 30, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants