@@ -1680,20 +1680,16 @@ describe('ReactDOMFizzServer', () => {
1680
1680
function getServerSnapshot ( ) {
1681
1681
return 'server' ;
1682
1682
}
1683
-
1684
1683
function getClientSnapshot ( ) {
1685
1684
return 'client' ;
1686
1685
}
1687
-
1688
1686
function subscribe ( ) {
1689
1687
return ( ) => { } ;
1690
1688
}
1691
-
1692
1689
function Child ( { text} ) {
1693
1690
Scheduler . unstable_yieldValue ( text ) ;
1694
1691
return text ;
1695
1692
}
1696
-
1697
1693
function App ( ) {
1698
1694
const value = useSyncExternalStore (
1699
1695
subscribe ,
@@ -1706,14 +1702,12 @@ describe('ReactDOMFizzServer', () => {
1706
1702
</ div >
1707
1703
) ;
1708
1704
}
1709
-
1710
1705
const loggedErrors = [ ] ;
1711
1706
await act ( async ( ) => {
1712
1707
const { pipe} = ReactDOMFizzServer . renderToPipeableStream (
1713
1708
< Suspense fallback = "Loading..." >
1714
1709
< App />
1715
1710
</ Suspense > ,
1716
-
1717
1711
{
1718
1712
onError ( x ) {
1719
1713
loggedErrors . push ( x ) ;
@@ -1737,38 +1731,30 @@ describe('ReactDOMFizzServer', () => {
1737
1731
} ) ;
1738
1732
1739
1733
// The selector implementation uses the lazy ref initialization pattern
1740
- // @gate supportsNativeUseSyncExternalStore
1741
1734
// @gate experimental
1742
1735
it ( 'calls getServerSnapshot instead of getSnapshot (with selector and isEqual)' , async ( ) => {
1743
1736
// Same as previous test, but with a selector that returns a complex object
1744
1737
// that is memoized with a custom `isEqual` function.
1745
1738
const ref = React . createRef ( ) ;
1746
-
1747
1739
function getServerSnapshot ( ) {
1748
1740
return { env : 'server' , other : 'unrelated' } ;
1749
1741
}
1750
-
1751
1742
function getClientSnapshot ( ) {
1752
1743
return { env : 'client' , other : 'unrelated' } ;
1753
1744
}
1754
-
1755
1745
function selector ( { env} ) {
1756
1746
return { env} ;
1757
1747
}
1758
-
1759
1748
function isEqual ( a , b ) {
1760
1749
return a . env === b . env ;
1761
1750
}
1762
-
1763
1751
function subscribe ( ) {
1764
1752
return ( ) => { } ;
1765
1753
}
1766
-
1767
1754
function Child ( { text} ) {
1768
1755
Scheduler . unstable_yieldValue ( text ) ;
1769
1756
return text ;
1770
1757
}
1771
-
1772
1758
function App ( ) {
1773
1759
const { env} = useSyncExternalStoreWithSelector (
1774
1760
subscribe ,
@@ -1783,14 +1769,12 @@ describe('ReactDOMFizzServer', () => {
1783
1769
</ div >
1784
1770
) ;
1785
1771
}
1786
-
1787
1772
const loggedErrors = [ ] ;
1788
1773
await act ( async ( ) => {
1789
1774
const { pipe} = ReactDOMFizzServer . renderToPipeableStream (
1790
1775
< Suspense fallback = "Loading..." >
1791
1776
< App />
1792
1777
</ Suspense > ,
1793
-
1794
1778
{
1795
1779
onError ( x ) {
1796
1780
loggedErrors . push ( x ) ;
0 commit comments