@@ -475,8 +475,7 @@ describe('ReactDOMInput', () => {
475
475
expect ( ( ) =>
476
476
ReactDOM . render ( < input type = "text" defaultValue = "1" /> , container ) ,
477
477
) . toWarnDev (
478
- 'A component is changing a controlled input of type ' +
479
- 'text to be uncontrolled.' ,
478
+ 'A component is changing a controlled input to be uncontrolled.' ,
480
479
) ;
481
480
expect ( node . value ) . toBe ( '0' ) ;
482
481
} ) ;
@@ -854,8 +853,7 @@ describe('ReactDOMInput', () => {
854
853
container ,
855
854
) ,
856
855
) . toWarnDev (
857
- 'A component is changing a controlled input of type ' +
858
- 'submit to be uncontrolled.' ,
856
+ 'A component is changing a controlled input to be uncontrolled.' ,
859
857
) ;
860
858
861
859
const node = container . firstChild ;
@@ -874,8 +872,7 @@ describe('ReactDOMInput', () => {
874
872
container ,
875
873
) ,
876
874
) . toWarnDev (
877
- 'A component is changing a controlled input of type ' +
878
- 'reset to be uncontrolled.' ,
875
+ 'A component is changing a controlled input to be uncontrolled.' ,
879
876
) ;
880
877
881
878
const node = container . firstChild ;
@@ -1268,8 +1265,9 @@ describe('ReactDOMInput', () => {
1268
1265
) ;
1269
1266
ReactDOM . render ( stub , container ) ;
1270
1267
expect ( ( ) => ReactDOM . render ( < input type = "text" /> , container ) ) . toWarnDev (
1271
- 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' +
1272
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1268
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1269
+ 'This is likely caused by the value changing from undefined to ' +
1270
+ 'a defined value, which should not happen. ' +
1273
1271
'Decide between using a controlled or uncontrolled input ' +
1274
1272
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1275
1273
' in input (at **)' ,
@@ -1286,8 +1284,9 @@ describe('ReactDOMInput', () => {
1286
1284
) . toWarnDev ( [
1287
1285
'`value` prop on `input` should not be null. ' +
1288
1286
'Consider using an empty string to clear the component or `undefined` for uncontrolled components' ,
1289
- 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' +
1290
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1287
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1288
+ 'This is likely caused by the value changing from undefined to ' +
1289
+ 'a defined value, which should not happen. ' +
1291
1290
'Decide between using a controlled or uncontrolled input ' +
1292
1291
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1293
1292
' in input (at **)' ,
@@ -1305,8 +1304,9 @@ describe('ReactDOMInput', () => {
1305
1304
container ,
1306
1305
) ,
1307
1306
) . toWarnDev (
1308
- 'Warning: A component is changing a controlled input of type text to be uncontrolled. ' +
1309
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1307
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1308
+ 'This is likely caused by the value changing from undefined to ' +
1309
+ 'a defined value, which should not happen. ' +
1310
1310
'Decide between using a controlled or uncontrolled input ' +
1311
1311
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1312
1312
' in input (at **)' ,
@@ -1319,8 +1319,9 @@ describe('ReactDOMInput', () => {
1319
1319
expect ( ( ) =>
1320
1320
ReactDOM . render ( < input type = "text" value = "controlled" /> , container ) ,
1321
1321
) . toWarnDev (
1322
- 'Warning: A component is changing an uncontrolled input of type text to be controlled. ' +
1323
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1322
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1323
+ 'This is likely caused by the value changing from a defined to ' +
1324
+ 'undefined, which should not happen. ' +
1324
1325
'Decide between using a controlled or uncontrolled input ' +
1325
1326
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1326
1327
' in input (at **)' ,
@@ -1336,8 +1337,9 @@ describe('ReactDOMInput', () => {
1336
1337
expect ( ( ) =>
1337
1338
ReactDOM . render ( < input type = "text" value = "controlled" /> , container ) ,
1338
1339
) . toWarnDev (
1339
- 'Warning: A component is changing an uncontrolled input of type text to be controlled. ' +
1340
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1340
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1341
+ 'This is likely caused by the value changing from a defined to ' +
1342
+ 'undefined, which should not happen. ' +
1341
1343
'Decide between using a controlled or uncontrolled input ' +
1342
1344
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1343
1345
' in input (at **)' ,
@@ -1352,8 +1354,9 @@ describe('ReactDOMInput', () => {
1352
1354
expect ( ( ) =>
1353
1355
ReactDOM . render ( < input type = "checkbox" /> , container ) ,
1354
1356
) . toWarnDev (
1355
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' +
1356
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1357
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1358
+ 'This is likely caused by the value changing from undefined to ' +
1359
+ 'a defined value, which should not happen. ' +
1357
1360
'Decide between using a controlled or uncontrolled input ' +
1358
1361
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1359
1362
' in input (at **)' ,
@@ -1368,8 +1371,9 @@ describe('ReactDOMInput', () => {
1368
1371
expect ( ( ) =>
1369
1372
ReactDOM . render ( < input type = "checkbox" checked = { null } /> , container ) ,
1370
1373
) . toWarnDev (
1371
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' +
1372
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1374
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1375
+ 'This is likely caused by the value changing from undefined to ' +
1376
+ 'a defined value, which should not happen. ' +
1373
1377
'Decide between using a controlled or uncontrolled input ' +
1374
1378
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1375
1379
' in input (at **)' ,
@@ -1387,8 +1391,9 @@ describe('ReactDOMInput', () => {
1387
1391
container ,
1388
1392
) ,
1389
1393
) . toWarnDev (
1390
- 'Warning: A component is changing a controlled input of type checkbox to be uncontrolled. ' +
1391
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1394
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1395
+ 'This is likely caused by the value changing from undefined to ' +
1396
+ 'a defined value, which should not happen. ' +
1392
1397
'Decide between using a controlled or uncontrolled input ' +
1393
1398
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1394
1399
' in input (at **)' ,
@@ -1401,8 +1406,9 @@ describe('ReactDOMInput', () => {
1401
1406
expect ( ( ) =>
1402
1407
ReactDOM . render ( < input type = "checkbox" checked = { true } /> , container ) ,
1403
1408
) . toWarnDev (
1404
- 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled. ' +
1405
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1409
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1410
+ 'This is likely caused by the value changing from a defined to ' +
1411
+ 'undefined, which should not happen. ' +
1406
1412
'Decide between using a controlled or uncontrolled input ' +
1407
1413
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1408
1414
' in input (at **)' ,
@@ -1415,8 +1421,9 @@ describe('ReactDOMInput', () => {
1415
1421
expect ( ( ) =>
1416
1422
ReactDOM . render ( < input type = "checkbox" checked = { true } /> , container ) ,
1417
1423
) . toWarnDev (
1418
- 'Warning: A component is changing an uncontrolled input of type checkbox to be controlled. ' +
1419
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1424
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1425
+ 'This is likely caused by the value changing from a defined to ' +
1426
+ 'undefined, which should not happen. ' +
1420
1427
'Decide between using a controlled or uncontrolled input ' +
1421
1428
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1422
1429
' in input (at **)' ,
@@ -1427,8 +1434,9 @@ describe('ReactDOMInput', () => {
1427
1434
const stub = < input type = "radio" checked = { true } onChange = { emptyFunction } /> ;
1428
1435
ReactDOM . render ( stub , container ) ;
1429
1436
expect ( ( ) => ReactDOM . render ( < input type = "radio" /> , container ) ) . toWarnDev (
1430
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1431
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1437
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1438
+ 'This is likely caused by the value changing from undefined to ' +
1439
+ 'a defined value, which should not happen. ' +
1432
1440
'Decide between using a controlled or uncontrolled input ' +
1433
1441
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1434
1442
' in input (at **)' ,
@@ -1441,8 +1449,9 @@ describe('ReactDOMInput', () => {
1441
1449
expect ( ( ) =>
1442
1450
ReactDOM . render ( < input type = "radio" checked = { null } /> , container ) ,
1443
1451
) . toWarnDev (
1444
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1445
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1452
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1453
+ 'This is likely caused by the value changing from undefined to ' +
1454
+ 'a defined value, which should not happen. ' +
1446
1455
'Decide between using a controlled or uncontrolled input ' +
1447
1456
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1448
1457
' in input (at **)' ,
@@ -1455,8 +1464,9 @@ describe('ReactDOMInput', () => {
1455
1464
expect ( ( ) =>
1456
1465
ReactDOM . render ( < input type = "radio" defaultChecked = { true } /> , container ) ,
1457
1466
) . toWarnDev (
1458
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1459
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1467
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1468
+ 'This is likely caused by the value changing from undefined to ' +
1469
+ 'a defined value, which should not happen. ' +
1460
1470
'Decide between using a controlled or uncontrolled input ' +
1461
1471
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1462
1472
' in input (at **)' ,
@@ -1469,8 +1479,9 @@ describe('ReactDOMInput', () => {
1469
1479
expect ( ( ) =>
1470
1480
ReactDOM . render ( < input type = "radio" checked = { true } /> , container ) ,
1471
1481
) . toWarnDev (
1472
- 'Warning: A component is changing an uncontrolled input of type radio to be controlled. ' +
1473
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1482
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1483
+ 'This is likely caused by the value changing from a defined to ' +
1484
+ 'undefined, which should not happen. ' +
1474
1485
'Decide between using a controlled or uncontrolled input ' +
1475
1486
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1476
1487
' in input (at **)' ,
@@ -1483,8 +1494,9 @@ describe('ReactDOMInput', () => {
1483
1494
expect ( ( ) =>
1484
1495
ReactDOM . render ( < input type = "radio" checked = { true } /> , container ) ,
1485
1496
) . toWarnDev (
1486
- 'Warning: A component is changing an uncontrolled input of type radio to be controlled. ' +
1487
- 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' +
1497
+ 'Warning: A component is changing an uncontrolled input to be controlled. ' +
1498
+ 'This is likely caused by the value changing from a defined to ' +
1499
+ 'undefined, which should not happen. ' +
1488
1500
'Decide between using a controlled or uncontrolled input ' +
1489
1501
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1490
1502
' in input (at **)' ,
@@ -1535,8 +1547,9 @@ describe('ReactDOMInput', () => {
1535
1547
expect ( ( ) =>
1536
1548
ReactDOM . render ( < input type = "radio" value = "value" /> , container ) ,
1537
1549
) . toWarnDev (
1538
- 'Warning: A component is changing a controlled input of type radio to be uncontrolled. ' +
1539
- 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' +
1550
+ 'Warning: A component is changing a controlled input to be uncontrolled. ' +
1551
+ 'This is likely caused by the value changing from undefined to ' +
1552
+ 'a defined value, which should not happen. ' +
1540
1553
'Decide between using a controlled or uncontrolled input ' +
1541
1554
'element for the lifetime of the component. More info: https://fb.me/react-controlled-components\n' +
1542
1555
' in input (at **)' ,
@@ -1817,8 +1830,7 @@ describe('ReactDOMInput', () => {
1817
1830
1818
1831
it ( 'reverts the value attribute to the initial value' , ( ) => {
1819
1832
expect ( renderInputWithStringThenWithUndefined ) . toWarnDev (
1820
- 'Input elements should not switch from controlled to ' +
1821
- 'uncontrolled (or vice versa).' ,
1833
+ 'A component is changing a controlled input to be uncontrolled.' ,
1822
1834
) ;
1823
1835
if ( disableInputAttributeSyncing ) {
1824
1836
expect ( input . getAttribute ( 'value' ) ) . toBe ( null ) ;
@@ -1829,8 +1841,7 @@ describe('ReactDOMInput', () => {
1829
1841
1830
1842
it ( 'preserves the value property' , ( ) => {
1831
1843
expect ( renderInputWithStringThenWithUndefined ) . toWarnDev (
1832
- 'Input elements should not switch from controlled to ' +
1833
- 'uncontrolled (or vice versa).' ,
1844
+ 'A component is changing a controlled input to be uncontrolled.' ,
1834
1845
) ;
1835
1846
expect ( input . value ) . toBe ( 'latest' ) ;
1836
1847
} ) ;
@@ -1869,8 +1880,7 @@ describe('ReactDOMInput', () => {
1869
1880
'`value` prop on `input` should not be null. ' +
1870
1881
'Consider using an empty string to clear the component ' +
1871
1882
'or `undefined` for uncontrolled components.' ,
1872
- 'Input elements should not switch from controlled ' +
1873
- 'to uncontrolled (or vice versa).' ,
1883
+ 'A component is changing a controlled input to be uncontrolled.' ,
1874
1884
] ) ;
1875
1885
if ( disableInputAttributeSyncing ) {
1876
1886
expect ( input . hasAttribute ( 'value' ) ) . toBe ( false ) ;
@@ -1884,8 +1894,7 @@ describe('ReactDOMInput', () => {
1884
1894
'`value` prop on `input` should not be null. ' +
1885
1895
'Consider using an empty string to clear the component ' +
1886
1896
'or `undefined` for uncontrolled components.' ,
1887
- 'Input elements should not switch from controlled ' +
1888
- 'to uncontrolled (or vice versa).' ,
1897
+ 'A component is changing a controlled input to be uncontrolled.' ,
1889
1898
] ) ;
1890
1899
expect ( input . value ) . toBe ( 'latest' ) ;
1891
1900
} ) ;
0 commit comments