-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build error using @react.componentWithProps with React.forwardRef
- Loading branch information
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
15 changes: 15 additions & 0 deletions
15
tests/build_tests/super_errors/expected/react_component_with_props.res.expected
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
[1;31mWe've found a bug for you![0m | ||
[36m/.../fixtures/react_component_with_props.res[0m:[2m4:5-13:10[0m | ||
|
||
2 [2m│[0m @react.componentWithProps | ||
3 [2m│[0m let make = React.forwardRef(( | ||
[1;31m4[0m [2m│[0m [1;31m~className=?,[0m | ||
[1;31m5[0m [2m│[0m [1;31m ~children,[0m | ||
[2m.[0m [2m│[0m [2m...[0m | ||
[1;31m12[0m [2m│[0m [1;31m children[0m | ||
[1;31m13[0m [2m│[0m [1;31m </div>[0m | ||
14 [2m│[0m ) | ||
15 [2m│[0m } | ||
|
||
Components using React.forwardRef cannot use @react.componentWithProps. Please use @react.component instead. |
15 changes: 15 additions & 0 deletions
15
tests/build_tests/super_errors/fixtures/react_component_with_props.res
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module V4C7 = { | ||
@react.componentWithProps | ||
let make = React.forwardRef(( | ||
~className=?, | ||
~children, | ||
ref: Js.Nullable.t<ReactRef.currentDomRef>, | ||
) => | ||
<div> | ||
<input | ||
type_="text" ?className ref=?{Js.Nullable.toOption(ref)->Belt.Option.map(React.Ref.domRef)} | ||
/> | ||
children | ||
</div> | ||
) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,4 +90,4 @@ module V4A6 = { | |
| #off => React.string("off") | ||
} | ||
} | ||
} | ||
} |