GeezerVison is showing github.com — Convert ReactDOMComponent-test to createRoot by kassens · Pull Request #28034 · react/react
Conversation
Convert ReactDOMComponent-test to createRoot
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
DominikLoncar and Oudinunit reacted with heart emoji
rickhanlonii
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
lgtm, there are a few tests that are flushing but not asserting between (i left some comments calling a couple out but there are more). Should we add assertions?
My thought process is:
- If we don't care about them flushing separately, then we can combine them inside the same
act call.
- If we do care about flushing separately, then we should assert on their output to confirm they flush a different value
I don't care strongly, but it smelled funny so I thought I would mention it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oudinunit reacted with heart emoji
|
|
const root = ReactDOMClient.createRoot(container);
|
|
|
await act(() => {
|
|
|
root.render(<some-custom-element foo="bar" />);
|
|
|
});
|
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.
Should there be an assert in between?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
nittaya111 reacted with heart emoji
|
|
});
|
|
|
await act(() => {
|
|
|
root.render(<div />);
|
|
|
});
|
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.
Should we add asserts in between?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
nittaya111 reacted with heart emoji
kassens
commented
Jan 23, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
I added some in the places you highlighted, but otherwise, I want to focus on translating the tests w/o reworking them too much since there's a lot to go through.
The different acts should probably be there even without asserts as something like rendering <div> then <div style={...}> then finally <div> again would just be collapsed into no actual dom writes when batched.
|
Oudinunit reacted with heart emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gnoff
added a commit
to gnoff/next.js
that referenced
this pull request
Feb 6, 2024
gnoff
added a commit
to vercel/next.js
that referenced
this pull request
Feb 6, 2024
EdisonVan
pushed a commit
to EdisonVan/react
that referenced
this pull request
Apr 15, 2024
Convert ReactDOMComponent-test to createRoot
bigfootjon
pushed a commit
that referenced
this pull request
Apr 18, 2024
Convert ReactDOMComponent-test to createRoot
DiffTrain build for commit b2d6371.
hanzo-dev
pushed a commit
to hanzoai/react
that referenced
this pull request
Sep 9, 2026
Convert ReactDOMComponent-test to createRoot
Reviewers
acdlite
Awaiting requested review from acdlite
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|