GeezerVison is showing github.com — Convert ReactDOMInput-test to createRoot by kassens · Pull Request #28084 · react/react
Conversation
Convert ReactDOMInput-test to createRoot
Sorry, something went wrong.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
ReactDOM.render(<input type="text" value="" />, container);
|
|
|
it('should warn for controlled value of "" with missing onChange', async () => {
|
|
|
await expect(async () => {
|
|
|
await act(() => {
|
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.
fwiw, i've been using flushSync for error assertions, because if a warning or other error is thrown this will crash jest watch mode
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
await act(() => {
|
|
|
root.render(<input type="checkbox" checked={false} readOnly={true} />);
|
|
|
});
|
|
|
root.unmount();
|
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.
Could use a key here instead of unmounting and re-creating the root
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
ReactDOM.render(<input type="checkbox" />, container);
|
|
|
ReactDOM.unmountComponentAtNode(container);
|
|
|
ReactDOM.render(<input type="checkbox" checked={undefined} />, container);
|
|
|
it('should not warn about missing onChange in uncontrolled inputs', async () => {
|
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.
Ditto here, could probably use a key.
Sorry, something went wrong.
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.
Since this contains so many changes already, I'm trying to keep the changes minimal. Refactoring some tests could still be done as a PR on top of this.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
});
|
|
|
await act(() => {
|
|
|
root.render(<input type="radio" value={0} onChange={function () {}} />);
|
|
|
});
|
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.
Might be worth including another test where they're in the same act, to confirm batching works. Ditto the test below
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
container,
|
|
|
await expect(async () => {
|
|
|
await expect(async () => {
|
|
|
await act(() => {
|
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.
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 ReactDOMInput-test to createRoot
bigfootjon
pushed a commit
that referenced
this pull request
Apr 18, 2024
Convert ReactDOMInput-test to createRoot
DiffTrain build for commit a7fa58d.
hanzo-dev
pushed a commit
to hanzoai/react
that referenced
this pull request
Sep 9, 2026
Convert ReactDOMInput-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.
|