File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
fixtures/unstable-async/suspense/src/components Expand file tree Collapse file tree 1 file changed +3
-10
lines changed 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' ;
2
2
import { unstable_scheduleCallback } from 'scheduler' ;
3
3
import {
4
4
unstable_trace as trace ,
5
5
unstable_wrap as wrap ,
6
6
} from 'scheduler/tracing' ;
7
- import { createResource } from 'react-cache' ;
8
- import { cache } from '../cache' ;
9
7
import Spinner from './Spinner' ;
10
8
import ContributorListPage from './ContributorListPage' ;
11
9
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' ) ) ;
18
11
19
12
export default class App extends PureComponent {
20
13
state = {
@@ -77,7 +70,7 @@ export default class App extends PureComponent {
77
70
Return to list
78
71
</ button >
79
72
< Suspense maxDuration = { 2000 } fallback = { < Spinner size = "large" /> } >
80
- < UserPageLoader id = { id } />
73
+ < UserPage id = { id } />
81
74
</ Suspense >
82
75
</ div >
83
76
) ;
You can’t perform that action at this time.
0 commit comments