@@ -1514,16 +1514,13 @@ describe('ReactFlight', () => {
15141514} ,
15151515} ;
15161516const transport = ReactNoopFlightServer . render ( < input value = { obj } /> ) ;
1517- assertConsoleErrorDev (
1518- [
1519- 'Only plain objects can be passed to Client Components from Server Components. ' +
1520- 'Objects with toJSON methods are not supported. ' +
1521- 'Convert it manually to a simple value before passing it to props.\n' +
1522- ' <input value={{toJSON: ...}}>\n' +
1523- ' ^^^^^^^^^^^^^^^' ,
1524- ] ,
1525- { withoutStack : true } ,
1526- ) ;
1517+ assertConsoleErrorDev ( [
1518+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1519+ 'Objects with toJSON methods are not supported. ' +
1520+ 'Convert it manually to a simple value before passing it to props.\n' +
1521+ ' <input value={{toJSON: ...}}>\n' +
1522+ ' ^^^^^^^^^^^^^^^' ,
1523+ ] ) ;
15271524
15281525ReactNoopFlightClient . read ( transport ) ;
15291526assertConsoleErrorDev ( [
@@ -1545,14 +1542,11 @@ describe('ReactFlight', () => {
15451542const transport = ReactNoopFlightServer . render (
15461543< div > Womp womp: { new MyError ( 'spaghetti' ) } </ div > ,
15471544) ;
1548- assertConsoleErrorDev (
1549- [
1550- 'Error objects cannot be rendered as text children. Try formatting it using toString().\n' +
1551- ' <div>Womp womp: {Error}</div>\n' +
1552- ' ^^^^^^^' ,
1553- ] ,
1554- { withoutStack : true } ,
1555- ) ;
1545+ assertConsoleErrorDev ( [
1546+ 'Error objects cannot be rendered as text children. Try formatting it using toString().\n' +
1547+ ' <div>Womp womp: {Error}</div>\n' +
1548+ ' ^^^^^^^' ,
1549+ ] ) ;
15561550
15571551ReactNoopFlightClient . read ( transport ) ;
15581552assertConsoleErrorDev ( [
@@ -1565,15 +1559,12 @@ describe('ReactFlight', () => {
15651559
15661560it ( 'should warn in DEV if a special object is passed to a host component' , ( ) => {
15671561const transport = ReactNoopFlightServer . render ( < input value = { Math } /> ) ;
1568- assertConsoleErrorDev (
1569- [
1570- 'Only plain objects can be passed to Client Components from Server Components. ' +
1571- 'Math objects are not supported.\n' +
1572- ' <input value={Math}>\n' +
1573- ' ^^^^^^' ,
1574- ] ,
1575- { withoutStack : true } ,
1576- ) ;
1562+ assertConsoleErrorDev ( [
1563+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1564+ 'Math objects are not supported.\n' +
1565+ ' <input value={Math}>\n' +
1566+ ' ^^^^^^' ,
1567+ ] ) ;
15771568
15781569ReactNoopFlightClient . read ( transport ) ;
15791570assertConsoleErrorDev ( [
@@ -1589,15 +1580,12 @@ describe('ReactFlight', () => {
15891580const transport = ReactNoopFlightServer . render (
15901581< input value = { { [ Symbol . iterator ] : { } } } /> ,
15911582) ;
1592- assertConsoleErrorDev (
1593- [
1594- 'Only plain objects can be passed to Client Components from Server Components. ' +
1595- 'Objects with symbol properties like Symbol.iterator are not supported.\n' +
1596- ' <input value={{}}>\n' +
1597- ' ^^^^' ,
1598- ] ,
1599- { withoutStack : true } ,
1600- ) ;
1583+ assertConsoleErrorDev ( [
1584+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1585+ 'Objects with symbol properties like Symbol.iterator are not supported.\n' +
1586+ ' <input value={{}}>\n' +
1587+ ' ^^^^' ,
1588+ ] ) ;
16011589
16021590ReactNoopFlightClient . read ( transport ) ;
16031591assertConsoleErrorDev ( [
@@ -1620,16 +1608,13 @@ describe('ReactFlight', () => {
16201608}
16211609const Client = clientReference ( ClientImpl ) ;
16221610const transport = ReactNoopFlightServer . render ( < Client value = { obj } /> ) ;
1623- assertConsoleErrorDev (
1624- [
1625- 'Only plain objects can be passed to Client Components from Server Components. ' +
1626- 'Objects with toJSON methods are not supported. ' +
1627- 'Convert it manually to a simple value before passing it to props.\n' +
1628- ' <... value={{toJSON: ...}}>\n' +
1629- ' ^^^^^^^^^^^^^^^' ,
1630- ] ,
1631- { withoutStack : true } ,
1632- ) ;
1611+ assertConsoleErrorDev ( [
1612+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1613+ 'Objects with toJSON methods are not supported. ' +
1614+ 'Convert it manually to a simple value before passing it to props.\n' +
1615+ ' <... value={{toJSON: ...}}>\n' +
1616+ ' ^^^^^^^^^^^^^^^' ,
1617+ ] ) ;
16331618
16341619ReactNoopFlightClient . read ( transport ) ;
16351620assertConsoleErrorDev ( [
@@ -1655,16 +1640,13 @@ describe('ReactFlight', () => {
16551640const transport = ReactNoopFlightServer . render (
16561641< Client > Current date: { obj } </ Client > ,
16571642) ;
1658- assertConsoleErrorDev (
1659- [
1660- 'Only plain objects can be passed to Client Components from Server Components. ' +
1661- 'Objects with toJSON methods are not supported. ' +
1662- 'Convert it manually to a simple value before passing it to props.\n' +
1663- ' <>Current date: {{toJSON: ...}}</>\n' +
1664- ' ^^^^^^^^^^^^^^^' ,
1665- ] ,
1666- { withoutStack : true } ,
1667- ) ;
1643+ assertConsoleErrorDev ( [
1644+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1645+ 'Objects with toJSON methods are not supported. ' +
1646+ 'Convert it manually to a simple value before passing it to props.\n' +
1647+ ' <>Current date: {{toJSON: ...}}</>\n' +
1648+ ' ^^^^^^^^^^^^^^^' ,
1649+ ] ) ;
16681650
16691651ReactNoopFlightClient . read ( transport ) ;
16701652assertConsoleErrorDev ( [
@@ -1683,15 +1665,12 @@ describe('ReactFlight', () => {
16831665}
16841666const Client = clientReference ( ClientImpl ) ;
16851667const transport = ReactNoopFlightServer . render ( < Client value = { Math } /> ) ;
1686- assertConsoleErrorDev (
1687- [
1688- 'Only plain objects can be passed to Client Components from Server Components. ' +
1689- 'Math objects are not supported.\n' +
1690- ' <... value={Math}>\n' +
1691- ' ^^^^^^' ,
1692- ] ,
1693- { withoutStack : true } ,
1694- ) ;
1668+ assertConsoleErrorDev ( [
1669+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1670+ 'Math objects are not supported.\n' +
1671+ ' <... value={Math}>\n' +
1672+ ' ^^^^^^' ,
1673+ ] ) ;
16951674
16961675ReactNoopFlightClient . read ( transport ) ;
16971676assertConsoleErrorDev ( [
@@ -1712,15 +1691,12 @@ describe('ReactFlight', () => {
17121691const transport = ReactNoopFlightServer . render (
17131692< Client value = { { [ Symbol . iterator ] : { } } } /> ,
17141693) ;
1715- assertConsoleErrorDev (
1716- [
1717- 'Only plain objects can be passed to Client Components from Server Components. ' +
1718- 'Objects with symbol properties like Symbol.iterator are not supported.\n' +
1719- ' <... value={{}}>\n' +
1720- ' ^^^^' ,
1721- ] ,
1722- { withoutStack : true } ,
1723- ) ;
1694+ assertConsoleErrorDev ( [
1695+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1696+ 'Objects with symbol properties like Symbol.iterator are not supported.\n' +
1697+ ' <... value={{}}>\n' +
1698+ ' ^^^^' ,
1699+ ] ) ;
17241700
17251701ReactNoopFlightClient . read ( transport ) ;
17261702
@@ -1744,13 +1720,10 @@ describe('ReactFlight', () => {
17441720ReactNoopFlightClient . read ( transport ) ;
17451721
17461722assertConsoleErrorDev ( [
1747- [
1748- 'Only plain objects can be passed to Client Components from Server Components. ' +
1749- 'Objects with symbol properties like Symbol.iterator are not supported.\n' +
1750- ' <... value={{}}>\n' +
1751- ' ^^^^' ,
1752- { withoutStack : true } ,
1753- ] ,
1723+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1724+ 'Objects with symbol properties like Symbol.iterator are not supported.\n' +
1725+ ' <... value={{}}>\n' +
1726+ ' ^^^^' ,
17541727'Only plain objects can be passed to Client Components from Server Components. ' +
17551728'Objects with symbol properties like Symbol.iterator are not supported.\n' +
17561729' <... value={{}}>\n' +
@@ -1769,13 +1742,10 @@ describe('ReactFlight', () => {
17691742) ;
17701743ReactNoopFlightClient . read ( transport ) ;
17711744assertConsoleErrorDev ( [
1772- [
1773- 'Only plain objects can be passed to Client Components from Server Components. ' +
1774- 'Math objects are not supported.\n' +
1775- ' [..., Math, <h1/>]\n' +
1776- ' ^^^^' ,
1777- { withoutStack : true } ,
1778- ] ,
1745+ 'Only plain objects can be passed to Client Components from Server Components. ' +
1746+ 'Math objects are not supported.\n' +
1747+ ' [..., Math, <h1/>]\n' +
1748+ ' ^^^^' ,
17791749'Only plain objects can be passed to Client Components from Server Components. ' +
17801750'Math objects are not supported.\n' +
17811751' [..., Math, <h1/>]\n' +
0 commit comments