@@ -479,8 +479,7 @@ describe('ReactDOMInput', () => {
479
479
expect ( ( ) =>
480
480
ReactDOM . render ( < input type = "text" defaultValue = "1" /> , container ) ,
481
481
) . toErrorDev (
482
- 'A component is changing a controlled input of type ' +
483
- 'text to be uncontrolled.' ,
482
+ 'A component is changing a controlled input to be uncontrolled.' ,
484
483
) ;
485
484
expect ( node . value ) . toBe ( '0' ) ;
486
485
} ) ;
@@ -858,8 +857,7 @@ describe('ReactDOMInput', () => {
858
857
container ,
859
858
) ,
860
859
) . toErrorDev (
861
- 'A component is changing a controlled input of type ' +
862
- 'submit to be uncontrolled.' ,
860
+ 'A component is changing a controlled input to be uncontrolled.' ,
863
861
) ;
864
862
865
863
const node = container . firstChild ;
@@ -878,8 +876,7 @@ describe('ReactDOMInput', () => {
878
876
container ,
879
877
) ,
880
878
) . toErrorDev (
881
- 'A component is changing a controlled input of type ' +
882
- 'reset to be uncontrolled.' ,
879
+ 'A component is changing a controlled input to be uncontrolled.' ,
883
880
) ;
884
881
885
882
const node = container . firstChild ;
@@ -1272,8 +1269,9 @@ describe('ReactDOMInput', () => {
1272
1269
) ;
1273
1270
ReactDOM . render ( stub , container ) ;
1274
1271
expect ( ( ) => ReactDOM . render ( < input type = "text" /> , container ) ) . toErrorDev (
1275
- 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' +
1276
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1272
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1273
+ 'This is likely caused by the value changing from a defined to ' +
1274
+ 'undefined, which should not happen. ' +
1277
1275
'Decide between using a controlled or uncontrolled input ' +
1278
1276
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1279
1277
' in input (at **)' ,
@@ -1290,8 +1288,9 @@ describe('ReactDOMInput', () => {
1290
1288
) . toErrorDev ( [
1291
1289
'`value` prop on `input` should not be null. ' +
1292
1290
'Consider using an empty string to clear the component or `undefined` for uncontrolled components' ,
1293
- 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' +
1294
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1291
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1292
+ 'This is likely caused by the value changing from a defined to ' +
1293
+ 'undefined, which should not happen. ' +
1295
1294
'Decide between using a controlled or uncontrolled input ' +
1296
1295
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1297
1296
' in input (at **)' ,
@@ -1309,8 +1308,9 @@ describe('ReactDOMInput', () => {
1309
1308
container ,
1310
1309
) ,
1311
1310
) . toErrorDev (
1312
- 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' +
1313
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1311
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1312
+ 'This is likely caused by the value changing from a defined to ' +
1313
+ 'undefined, which should not happen. ' +
1314
1314
'Decide between using a controlled or uncontrolled input ' +
1315
1315
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1316
1316
' in input (at **)' ,
@@ -1323,8 +1323,9 @@ describe('ReactDOMInput', () => {
1323
1323
expect ( ( ) =>
1324
1324
ReactDOM . render ( < input type = "text" value = "controlled" /> , container ) ,
1325
1325
) . toErrorDev (
1326
- 'Warning: A component is changing an uncontrolled input of type text to be controlled. ' +
1327
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1326
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1327
+ 'This is likely caused by the value changing from undefined to ' +
1328
+ 'a defined value, which should not happen. ' +
1328
1329
'Decide between using a controlled or uncontrolled input ' +
1329
1330
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1330
1331
' in input (at **)' ,
@@ -1340,8 +1341,9 @@ describe('ReactDOMInput', () => {
1340
1341
expect ( ( ) =>
1341
1342
ReactDOM . render ( < input type = "text" value = "controlled" /> , container ) ,
1342
1343
) . toErrorDev (
1343
- 'Warning: A component is changing an uncontrolled input of type text to be controlled. ' +
1344
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1344
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1345
+ 'This is likely caused by the value changing from undefined to ' +
1346
+ 'a defined value, which should not happen. ' +
1345
1347
'Decide between using a controlled or uncontrolled input ' +
1346
1348
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1347
1349
' in input (at **)' ,
@@ -1356,8 +1358,9 @@ describe('ReactDOMInput', () => {
1356
1358
expect ( ( ) =>
1357
1359
ReactDOM . render ( < input type = "checkbox" /> , container ) ,
1358
1360
) . toErrorDev (
1359
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' +
1360
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1361
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1362
+ 'This is likely caused by the value changing from a defined to ' +
1363
+ 'undefined, which should not happen. ' +
1361
1364
'Decide between using a controlled or uncontrolled input ' +
1362
1365
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1363
1366
' in input (at **)' ,
@@ -1372,8 +1375,9 @@ describe('ReactDOMInput', () => {
1372
1375
expect ( ( ) =>
1373
1376
ReactDOM . render ( < input type = "checkbox" checked = { null } /> , container ) ,
1374
1377
) . toErrorDev (
1375
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' +
1376
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1378
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1379
+ 'This is likely caused by the value changing from a defined to ' +
1380
+ 'undefined, which should not happen. ' +
1377
1381
'Decide between using a controlled or uncontrolled input ' +
1378
1382
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1379
1383
' in input (at **)' ,
@@ -1391,8 +1395,9 @@ describe('ReactDOMInput', () => {
1391
1395
container ,
1392
1396
) ,
1393
1397
) . toErrorDev (
1394
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' +
1395
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1398
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1399
+ 'This is likely caused by the value changing from a defined to ' +
1400
+ 'undefined, which should not happen. ' +
1396
1401
'Decide between using a controlled or uncontrolled input ' +
1397
1402
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1398
1403
' in input (at **)' ,
@@ -1405,8 +1410,9 @@ describe('ReactDOMInput', () => {
1405
1410
expect ( ( ) =>
1406
1411
ReactDOM . render ( < input type = "checkbox" checked = { true } /> , container ) ,
1407
1412
) . toErrorDev (
1408
- 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled. ' +
1409
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1413
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1414
+ 'This is likely caused by the value changing from undefined to ' +
1415
+ 'a defined value, which should not happen. ' +
1410
1416
'Decide between using a controlled or uncontrolled input ' +
1411
1417
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1412
1418
' in input (at **)' ,
@@ -1419,8 +1425,9 @@ describe('ReactDOMInput', () => {
1419
1425
expect ( ( ) =>
1420
1426
ReactDOM . render ( < input type = "checkbox" checked = { true } /> , container ) ,
1421
1427
) . toErrorDev (
1422
- 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled. ' +
1423
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1428
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1429
+ 'This is likely caused by the value changing from undefined to ' +
1430
+ 'a defined value, which should not happen. ' +
1424
1431
'Decide between using a controlled or uncontrolled input ' +
1425
1432
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1426
1433
' in input (at **)' ,
@@ -1431,8 +1438,9 @@ describe('ReactDOMInput', () => {
1431
1438
const stub = < input type = "radio" checked = { true } onChange = { emptyFunction } /> ;
1432
1439
ReactDOM . render ( stub , container ) ;
1433
1440
expect ( ( ) => ReactDOM . render ( < input type = "radio" /> , container ) ) . toErrorDev (
1434
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1435
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1441
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1442
+ 'This is likely caused by the value changing from a defined to ' +
1443
+ 'undefined, which should not happen. ' +
1436
1444
'Decide between using a controlled or uncontrolled input ' +
1437
1445
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1438
1446
' in input (at **)' ,
@@ -1445,8 +1453,9 @@ describe('ReactDOMInput', () => {
1445
1453
expect ( ( ) =>
1446
1454
ReactDOM . render ( < input type = "radio" checked = { null } /> , container ) ,
1447
1455
) . toErrorDev (
1448
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1449
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1456
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1457
+ 'This is likely caused by the value changing from a defined to ' +
1458
+ 'undefined, which should not happen. ' +
1450
1459
'Decide between using a controlled or uncontrolled input ' +
1451
1460
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1452
1461
' in input (at **)' ,
@@ -1459,8 +1468,9 @@ describe('ReactDOMInput', () => {
1459
1468
expect ( ( ) =>
1460
1469
ReactDOM . render ( < input type = "radio" defaultChecked = { true } /> , container ) ,
1461
1470
) . toErrorDev (
1462
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1463
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1471
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1472
+ 'This is likely caused by the value changing from a defined to ' +
1473
+ 'undefined, which should not happen. ' +
1464
1474
'Decide between using a controlled or uncontrolled input ' +
1465
1475
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1466
1476
' in input (at **)' ,
@@ -1473,8 +1483,9 @@ describe('ReactDOMInput', () => {
1473
1483
expect ( ( ) =>
1474
1484
ReactDOM . render ( < input type = "radio" checked = { true } /> , container ) ,
1475
1485
) . toErrorDev (
1476
- 'Warning: A component is changing an uncontrolled input of type radio to be controlled. ' +
1477
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1486
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1487
+ 'This is likely caused by the value changing from undefined to ' +
1488
+ 'a defined value, which should not happen. ' +
1478
1489
'Decide between using a controlled or uncontrolled input ' +
1479
1490
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1480
1491
' in input (at **)' ,
@@ -1487,8 +1498,9 @@ describe('ReactDOMInput', () => {
1487
1498
expect ( ( ) =>
1488
1499
ReactDOM . render ( < input type = "radio" checked = { true } /> , container ) ,
1489
1500
) . toErrorDev (
1490
- 'Warning: A component is changing an uncontrolled input of type radio to be controlled. ' +
1491
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1501
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1502
+ 'This is likely caused by the value changing from undefined to ' +
1503
+ 'a defined value, which should not happen. ' +
1492
1504
'Decide between using a controlled or uncontrolled input ' +
1493
1505
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1494
1506
' in input (at **)' ,
@@ -1539,8 +1551,9 @@ describe('ReactDOMInput', () => {
1539
1551
expect ( ( ) =>
1540
1552
ReactDOM . render ( < input type = "radio" value = "value" /> , container ) ,
1541
1553
) . toErrorDev (
1542
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1543
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1554
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1555
+ 'This is likely caused by the value changing from a defined to ' +
1556
+ 'undefined, which should not happen. ' +
1544
1557
'Decide between using a controlled or uncontrolled input ' +
1545
1558
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1546
1559
' in input (at **)' ,
@@ -1837,8 +1850,7 @@ describe('ReactDOMInput', () => {
1837
1850
1838
1851
it ( 'reverts the value attribute to the initial value' , ( ) => {
1839
1852
expect ( renderInputWithStringThenWithUndefined ) . toErrorDev (
1840
- 'Input elements should not switch from controlled to ' +
1841
- 'uncontrolled (or vice versa).' ,
1853
+ 'A component is changing a controlled input to be uncontrolled.' ,
1842
1854
) ;
1843
1855
if ( disableInputAttributeSyncing ) {
1844
1856
expect ( input . getAttribute ( 'value' ) ) . toBe ( null ) ;
@@ -1849,8 +1861,7 @@ describe('ReactDOMInput', () => {
1849
1861
1850
1862
it ( 'preserves the value property' , ( ) => {
1851
1863
expect ( renderInputWithStringThenWithUndefined ) . toErrorDev (
1852
- 'Input elements should not switch from controlled to ' +
1853
- 'uncontrolled (or vice versa).' ,
1864
+ 'A component is changing a controlled input to be uncontrolled.' ,
1854
1865
) ;
1855
1866
expect ( input . value ) . toBe ( 'latest' ) ;
1856
1867
} ) ;
@@ -1889,8 +1900,7 @@ describe('ReactDOMInput', () => {
1889
1900
'`value` prop on `input` should not be null. ' +
1890
1901
'Consider using an empty string to clear the component ' +
1891
1902
'or `undefined` for uncontrolled components.' ,
1892
- 'Input elements should not switch from controlled ' +
1893
- 'to uncontrolled (or vice versa).' ,
1903
+ 'A component is changing a controlled input to be uncontrolled.' ,
1894
1904
] ) ;
1895
1905
if ( disableInputAttributeSyncing ) {
1896
1906
expect ( input . hasAttribute ( 'value' ) ) . toBe ( false ) ;
@@ -1904,8 +1914,7 @@ describe('ReactDOMInput', () => {
1904
1914
'`value` prop on `input` should not be null. ' +
1905
1915
'Consider using an empty string to clear the component ' +
1906
1916
'or `undefined` for uncontrolled components.' ,
1907
- 'Input elements should not switch from controlled ' +
1908
- 'to uncontrolled (or vice versa).' ,
1917
+ 'A component is changing a controlled input to be uncontrolled.' ,
1909
1918
] ) ;
1910
1919
expect ( input . value ) . toBe ( 'latest' ) ;
1911
1920
} ) ;
0 commit comments