diff --git a/packages/react-dom/src/__tests__/ReactDOMInput-test.js b/packages/react-dom/src/__tests__/ReactDOMInput-test.js index be4b59ce0806e..6b8baaddbe023 100644 --- a/packages/react-dom/src/__tests__/ReactDOMInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMInput-test.js @@ -110,7 +110,10 @@ describe('ReactDOMInput', () => { expect(() => { ReactDOM.render(, container); }).toErrorDev( - 'Warning: You provided a `value` prop to a form field without an `onChange` handler.', + 'Warning: You provided a `value` prop to a form ' + + 'field without an `onChange` handler. This will render a read-only ' + + 'field. If the field should be mutable use `defaultValue`. ' + + 'Otherwise, set either `onChange` or `readOnly`.', ); }); @@ -118,7 +121,10 @@ describe('ReactDOMInput', () => { expect(() => { ReactDOM.render(, container); }).toErrorDev( - 'Warning: You provided a `value` prop to a form field without an `onChange` handler.', + 'Warning: You provided a `value` prop to a form ' + + 'field without an `onChange` handler. This will render a read-only ' + + 'field. If the field should be mutable use `defaultValue`. ' + + 'Otherwise, set either `onChange` or `readOnly`.', ); }); @@ -126,7 +132,10 @@ describe('ReactDOMInput', () => { expect(() => { ReactDOM.render(, container); }).toErrorDev( - 'Warning: You provided a `value` prop to a form field without an `onChange` handler.', + 'Warning: You provided a `value` prop to a form ' + + 'field without an `onChange` handler. This will render a read-only ' + + 'field. If the field should be mutable use `defaultValue`. ' + + 'Otherwise, set either `onChange` or `readOnly`.', ); }); diff --git a/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js b/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js index 39a1bac1e9ede..810452c64a313 100644 --- a/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMTextarea-test.js @@ -759,4 +759,85 @@ describe('ReactDOMTextarea', () => { ReactDOM.render(