File tree Expand file tree Collapse file tree
fixtures/unstable-async/suspense/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import React , { unstable_Suspense as Suspense , PureComponent } from 'react' ;
1+ import React , { lazy , unstable_Suspense as Suspense , PureComponent } from 'react' ;
22import { unstable_scheduleCallback } from 'scheduler' ;
33import {
44 unstable_trace as trace ,
55 unstable_wrap as wrap ,
66} from 'scheduler/tracing' ;
7- import { createResource } from 'react-cache' ;
8- import { cache } from '../cache' ;
97import Spinner from './Spinner' ;
108import ContributorListPage from './ContributorListPage' ;
119
12- const UserPageResource = createResource ( ( ) => import ( './UserPage' ) ) ;
13-
14- function UserPageLoader ( props ) {
15- const UserPage = UserPageResource . read ( cache ) . default ;
16- return < UserPage { ...props } /> ;
17- }
10+ const UserPage = lazy ( ( ) => import ( './UserPage' ) ) ;
1811
1912export default class App extends PureComponent {
2013 state = {
@@ -77,7 +70,7 @@ export default class App extends PureComponent {
7770 Return to list
7871 </ button >
7972 < Suspense maxDuration = { 2000 } fallback = { < Spinner size = "large" /> } >
80- < UserPageLoader id = { id } />
73+ < UserPage id = { id } />
8174 </ Suspense >
8275 </ div >
8376 ) ;
You can’t perform that action at this time.
0 commit comments