From 18aecb49ecbdac37d5429287f8b132460ef9faf5 Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Fri, 11 Oct 2019 15:58:14 -0400 Subject: [PATCH 1/6] Make uncontrolled -> controlled warning clearer --- packages/react-dom/src/client/ReactDOMInput.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/client/ReactDOMInput.js b/packages/react-dom/src/client/ReactDOMInput.js index 54cef45d1a826..ba4c7dd6b57f0 100644 --- a/packages/react-dom/src/client/ReactDOMInput.js +++ b/packages/react-dom/src/client/ReactDOMInput.js @@ -145,8 +145,8 @@ export function updateWrapper(element: Element, props: Object) { ) { warning( false, - 'A component is changing an uncontrolled input of type %s to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'An input was created with a %s value, but was later passed a value. ' + + 'This changes it from an uncontrolled to controlled input, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type, From edfaae17935a2973f529862e711db786279ad744 Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Thu, 2 Jan 2020 10:12:07 -0500 Subject: [PATCH 2/6] Update phrasing, mirror for opposite direction --- packages/react-dom/src/client/ReactDOMInput.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/react-dom/src/client/ReactDOMInput.js b/packages/react-dom/src/client/ReactDOMInput.js index ba4c7dd6b57f0..b5a0d9b1fae42 100644 --- a/packages/react-dom/src/client/ReactDOMInput.js +++ b/packages/react-dom/src/client/ReactDOMInput.js @@ -145,8 +145,9 @@ export function updateWrapper(element: Element, props: Object) { ) { warning( false, - 'An input was created with a %s value, but was later passed a value. ' + - 'This changes it from an uncontrolled to controlled input, which should not happen. ' + + 'A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type, @@ -160,8 +161,9 @@ export function updateWrapper(element: Element, props: Object) { ) { warning( false, - 'A component is changing a controlled input of type %s to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type, From 43b75866ae0ad223640de1ece2ecaff31f7d72c3 Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Thu, 2 Jan 2020 10:33:08 -0500 Subject: [PATCH 3/6] Remove unused substitution --- packages/react-dom/src/client/ReactDOMInput.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/react-dom/src/client/ReactDOMInput.js b/packages/react-dom/src/client/ReactDOMInput.js index b5a0d9b1fae42..0ff3a12ff361e 100644 --- a/packages/react-dom/src/client/ReactDOMInput.js +++ b/packages/react-dom/src/client/ReactDOMInput.js @@ -150,7 +150,6 @@ export function updateWrapper(element: Element, props: Object) { 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', - props.type, ); didWarnUncontrolledToControlled = true; } @@ -166,7 +165,6 @@ export function updateWrapper(element: Element, props: Object) { 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', - props.type, ); didWarnControlledToUncontrolled = true; } From eb7d88f48c8cc1915915b99736d94dd4bdab32e8 Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Thu, 2 Jan 2020 10:33:54 -0500 Subject: [PATCH 4/6] Update warning tests --- .../__tests__/DOMPropertyOperations-test.js | 2 +- .../__tests__/ReactDOMComponentTree-test.js | 6 +- .../src/__tests__/ReactDOMInput-test.js | 101 ++++++++++-------- 3 files changed, 59 insertions(+), 50 deletions(-) diff --git a/packages/react-dom/src/__tests__/DOMPropertyOperations-test.js b/packages/react-dom/src/__tests__/DOMPropertyOperations-test.js index 16821b1b3f314..63929066e67c0 100644 --- a/packages/react-dom/src/__tests__/DOMPropertyOperations-test.js +++ b/packages/react-dom/src/__tests__/DOMPropertyOperations-test.js @@ -184,7 +184,7 @@ describe('DOMPropertyOperations', () => { container, ), ).toWarnDev( - 'A component is changing a controlled input of type text to be uncontrolled', + 'A component is changing a controlled input to be uncontrolled', ); if (disableInputAttributeSyncing) { expect(container.firstChild.hasAttribute('value')).toBe(false); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js b/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js index cf96a5f41f362..c0511d623f9f3 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js @@ -178,9 +178,9 @@ describe('ReactDOMComponentTree', () => { const component = ; const instance = ReactDOM.render(component, container); expect(() => simulateInput(instance.a, finishValue)).toWarnDev( - 'Warning: A component is changing an uncontrolled input of ' + - 'type text to be controlled. Input elements should not ' + - 'switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be ' + + 'controlled. This is likely caused by the value changing from ' + + 'a defined to undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: ' + 'https://fb.me/react-controlled-components', diff --git a/packages/react-dom/src/__tests__/ReactDOMInput-test.js b/packages/react-dom/src/__tests__/ReactDOMInput-test.js index e9f917bd067c7..396fccd570ffe 100644 --- a/packages/react-dom/src/__tests__/ReactDOMInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMInput-test.js @@ -475,8 +475,7 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'A component is changing a controlled input of type ' + - 'text to be uncontrolled.', + 'A component is changing a controlled input to be uncontrolled.', ); expect(node.value).toBe('0'); }); @@ -854,8 +853,7 @@ describe('ReactDOMInput', () => { container, ), ).toWarnDev( - 'A component is changing a controlled input of type ' + - 'submit to be uncontrolled.', + 'A component is changing a controlled input to be uncontrolled.', ); const node = container.firstChild; @@ -874,8 +872,7 @@ describe('ReactDOMInput', () => { container, ), ).toWarnDev( - 'A component is changing a controlled input of type ' + - 'reset to be uncontrolled.', + 'A component is changing a controlled input to be uncontrolled.', ); const node = container.firstChild; @@ -1268,8 +1265,9 @@ describe('ReactDOMInput', () => { ); ReactDOM.render(stub, container); expect(() => ReactDOM.render(, container)).toWarnDev( - 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1286,8 +1284,9 @@ describe('ReactDOMInput', () => { ).toWarnDev([ '`value` prop on `input` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` for uncontrolled components', - 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1305,8 +1304,9 @@ describe('ReactDOMInput', () => { container, ), ).toWarnDev( - 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1319,8 +1319,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing an uncontrolled input of type text to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1336,8 +1337,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing an uncontrolled input of type text to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1352,8 +1354,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1368,8 +1371,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1387,8 +1391,9 @@ describe('ReactDOMInput', () => { container, ), ).toWarnDev( - 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1401,8 +1406,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1415,8 +1421,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1427,8 +1434,9 @@ describe('ReactDOMInput', () => { const stub = ; ReactDOM.render(stub, container); expect(() => ReactDOM.render(, container)).toWarnDev( - 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1441,8 +1449,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1455,8 +1464,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1469,8 +1479,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing an uncontrolled input of type radio to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1483,8 +1494,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing an uncontrolled input of type radio to be controlled. ' + - 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1535,8 +1547,9 @@ describe('ReactDOMInput', () => { expect(() => ReactDOM.render(, container), ).toWarnDev( - 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' + - 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + + 'Warning: A component is changing a controlled input to be uncontrolled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1817,8 +1830,7 @@ describe('ReactDOMInput', () => { it('reverts the value attribute to the initial value', () => { expect(renderInputWithStringThenWithUndefined).toWarnDev( - 'Input elements should not switch from controlled to ' + - 'uncontrolled (or vice versa).', + 'A component is changing a controlled input to be uncontrolled.', ); if (disableInputAttributeSyncing) { expect(input.getAttribute('value')).toBe(null); @@ -1829,8 +1841,7 @@ describe('ReactDOMInput', () => { it('preserves the value property', () => { expect(renderInputWithStringThenWithUndefined).toWarnDev( - 'Input elements should not switch from controlled to ' + - 'uncontrolled (or vice versa).', + 'A component is changing a controlled input to be uncontrolled.', ); expect(input.value).toBe('latest'); }); @@ -1869,8 +1880,7 @@ describe('ReactDOMInput', () => { '`value` prop on `input` should not be null. ' + 'Consider using an empty string to clear the component ' + 'or `undefined` for uncontrolled components.', - 'Input elements should not switch from controlled ' + - 'to uncontrolled (or vice versa).', + 'A component is changing a controlled input to be uncontrolled.', ]); if (disableInputAttributeSyncing) { expect(input.hasAttribute('value')).toBe(false); @@ -1884,8 +1894,7 @@ describe('ReactDOMInput', () => { '`value` prop on `input` should not be null. ' + 'Consider using an empty string to clear the component ' + 'or `undefined` for uncontrolled components.', - 'Input elements should not switch from controlled ' + - 'to uncontrolled (or vice versa).', + 'A component is changing a controlled input to be uncontrolled.', ]); expect(input.value).toBe('latest'); }); From 2a1088c03a09d09467a944a1a85fc52213de737b Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Thu, 2 Jan 2020 10:46:50 -0500 Subject: [PATCH 5/6] Literally got these backwards, womp womp --- packages/react-dom/src/client/ReactDOMInput.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-dom/src/client/ReactDOMInput.js b/packages/react-dom/src/client/ReactDOMInput.js index 2f826e98bf2a5..2d7efd24ffaae 100644 --- a/packages/react-dom/src/client/ReactDOMInput.js +++ b/packages/react-dom/src/client/ReactDOMInput.js @@ -142,8 +142,8 @@ export function updateWrapper(element: Element, props: Object) { ) { console.error( 'A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', ); @@ -156,8 +156,8 @@ export function updateWrapper(element: Element, props: Object) { ) { console.error( 'A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', ); From dbe2dcc97ae98d64cdd3b890a0c3698996c58014 Mon Sep 17 00:00:00 2001 From: Carl Vitullo Date: Thu, 2 Jan 2020 11:03:22 -0500 Subject: [PATCH 6/6] Rerere-fix tests --- .../__tests__/ReactDOMComponentTree-test.js | 6 +- .../src/__tests__/ReactDOMInput-test.js | 64 +++++++++---------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js b/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js index feedb71505b2e..cc2f557706805 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js @@ -178,9 +178,9 @@ describe('ReactDOMComponentTree', () => { const component = ; const instance = ReactDOM.render(component, container); expect(() => simulateInput(instance.a, finishValue)).toErrorDev( - 'Warning: A component is changing an uncontrolled input to be ' + - 'controlled. This is likely caused by the value changing from ' + - 'a defined to undefined, which should not happen. ' + + 'Warning: A component is changing an uncontrolled input to be controlled. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: ' + 'https://fb.me/react-controlled-components', diff --git a/packages/react-dom/src/__tests__/ReactDOMInput-test.js b/packages/react-dom/src/__tests__/ReactDOMInput-test.js index 04377ae7b55eb..007e91166709a 100644 --- a/packages/react-dom/src/__tests__/ReactDOMInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMInput-test.js @@ -1266,8 +1266,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(stub, container); expect(() => ReactDOM.render(, container)).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1285,8 +1285,8 @@ describe('ReactDOMInput', () => { '`value` prop on `input` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` for uncontrolled components', 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1305,8 +1305,8 @@ describe('ReactDOMInput', () => { ), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1320,8 +1320,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1338,8 +1338,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1355,8 +1355,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1372,8 +1372,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1392,8 +1392,8 @@ describe('ReactDOMInput', () => { ), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1407,8 +1407,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1422,8 +1422,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1435,8 +1435,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(stub, container); expect(() => ReactDOM.render(, container)).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1450,8 +1450,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1465,8 +1465,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1480,8 +1480,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1495,8 +1495,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing an uncontrolled input to be controlled. ' + - 'This is likely caused by the value changing from a defined to ' + - 'undefined, which should not happen. ' + + 'This is likely caused by the value changing from undefined to ' + + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)', @@ -1548,8 +1548,8 @@ describe('ReactDOMInput', () => { ReactDOM.render(, container), ).toErrorDev( 'Warning: A component is changing a controlled input to be uncontrolled. ' + - 'This is likely caused by the value changing from undefined to ' + - 'a defined value, which should not happen. ' + + 'This is likely caused by the value changing from a defined to ' + + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' + ' in input (at **)',