This repository was archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Fix react comp key type #693
Merged
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bff8745
fix react comp key type
mununki 3a12ce1
add tests
mununki 6881b10
call renamed jsx binding
mununki 16203d7
add test
mununki 30bab47
add more examples
mununki 556bda4
fix key type of lowercase jsx runtime
mununki e4b056e
add more examples
mununki 1b92972
update jsx v4 spec about key type
mununki c677540
fix JSX v4 spec
mununki 03c1467
update changelog
mununki 7bf775c
add jsx key type tests
mununki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,7 +167,10 @@ module V4A = { | |
"div", | ||
{ | ||
children: ?ReactDOM.someElement( | ||
React.jsx(FancyInput.make, {ref: input, children: {React.string("Click to focus")}}), | ||
React.jsxWithKey( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why jsxWithKey if the key is not passed? |
||
FancyInput.make, | ||
{ref: input, children: {React.string("Click to focus")}}, | ||
), | ||
), | ||
}, | ||
) | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ let c2 = React.createElement(A.make, {...p, x: "x"}) | |
// let c0 = <A x="x" {...p0} {...p1} /> | ||
|
||
// only spread props | ||
let c1 = React.jsx(A.make, p) | ||
let c1 = React.jsxWithKey(A.make, p) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
|
||
// reversed order | ||
let c2 = React.jsx(A.make, {...p, x: "x"}) | ||
let c2 = React.jsxWithKey(A.make, {...p, x: "x"}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
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.
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.
why
jsxWithKey
if the key is not passed?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.
https://github.com/rescript-lang/rescript-react/blob/5e09771ae19b52bdb50061da15265b1093b6b61b/src/React.res#L51:L55
I think I should rename this function. 🤔