Repository navigation
Add error using @react.componentWithProps with external - #7217
Merged
Merged
Conversation
cknitt
reviewed
Dec 26, 2024
| | _, [_] -> | ||
| Jsx_common.raise_error ~loc:pstr_loc | ||
| "Components cannot be defined as externals when using \ | ||
| @react.componentWithProps. Please use @react.component instead." |
Member
There was a problem hiding this comment.
I think if the user intended to define a React component as a function of a props record, we should rather tell him to use the type React.component<props> in his external definition instead.
So maybe the message should be something like
Components cannot be defined as externals when using @react.componentWithProps.
If you intended to define an external for a React component using a props type,
use the type React.component<props> instead.
Alternatively, use @react.component for an external definition with labeled arguments.
cknitt
approved these changes
Dec 30, 2024
Member
|
Oh, CI failed, you still need to update the error message in the tests. |
Member
Author
Oh, I forgot it. Done 4e2d358 |
cknitt
approved these changes
Dec 30, 2024
aspeddro
pushed a commit
to aspeddro/rescript-compiler
that referenced
this pull request
Oct 31, 2026
…-lang#7217) * Add error using @react.componentWithProps with external * wildcard pattern * change log * fix error message * update error message Signed-off-by: Pedro Castro <aspeddro@gmail.com>
53 of 80 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7215