dillon1000/react
Commit
Browse files Don't update textarea defaultValue and input checked unnecessarily (#26580)
In #26573 I changed it so that textareas get their defaultValue reset if you don't specify one. However, the way that was implemented, it always set it for any update even if it hasn't changed. We have a test for that, but that test only works if no properties update at all so that no update was scheduled. This fixes the test so that it updates some unrelated prop. I also found a test for `checked` that needed a similar fix. Interestingly, we don't do this deduping for `defaultValue` or `defaultChecked` on inputs and there's no test for that.
Changed paths4 files
First-parent comparisonpackages/react-dom-bindings/src/client/ReactDOMInput.js ModifiedM packages/react-dom-bindings/src/client/ReactDOMTextarea.js ModifiedM packages/react-dom/src/__tests__/ReactDOMComponent-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMTextarea-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…