File tree Expand file tree Collapse file tree 6 files changed +995
-508
lines changed
examples/react-hot-loader Expand file tree Collapse file tree 6 files changed +995
-508
lines changed Original file line number Diff line number Diff line change
1
+ [ignore]
2
+
3
+ [include]
4
+
5
+ [libs]
6
+
7
+ [lints]
8
+
9
+ [options]
10
+ include_warnings=true
11
+
12
+ [strict]
Original file line number Diff line number Diff line change 11
11
"babel-plugin-transform-class-properties" : " ^6.24.1" ,
12
12
"babel-preset-env" : " ^1.6.1" ,
13
13
"babel-preset-react" : " ^6.24.1" ,
14
+ "flow-bin" : " ^0.74.0" ,
14
15
"html-webpack-plugin" : " ^3.2.0" ,
15
16
"webpack" : " ^4.9.1" ,
16
17
"webpack-dev-server" : " ^3.1.4"
Original file line number Diff line number Diff line change 1
- import { hot , setConfig } from 'react-hot-loader'
1
+ // @flow
2
+ import { hot , setConfig } from 'react-hot-loader'
2
3
import * as React from 'react'
3
4
import Counter from './Counter'
4
- import imported from 'react-imported-component'
5
+ import imported , { ComponentLoader } from 'react-imported-component'
5
6
import Portal from './Portal'
6
7
8
+ imported ( ( ) => import ( /* webpackChunkName: "namedChunk-1" */ './DeferredRender' ) , {
9
+ async : true
10
+ } ) ;
11
+
7
12
const Async = imported ( ( ) => import ( /* webpackChunkName: "namedChunk-1" */ './DeferredRender' ) ) ;
8
13
const Async2 = imported ( ( ) => import ( /* webpackChunkName: "namedChunk-2" */ './DeferredRender' ) ) ;
9
14
const ShouldNotBeImported = imported ( ( ) => import ( /* webpackChunkName: "namedChunk-2" */ './NotImported' ) ) ;
10
15
11
16
const App = ( ) => (
12
17
< h1 >
18
+ < ComponentLoader
19
+ loadable = { ( ) => import ( /* webpackChunkName: "namedChunk-1" */ './DeferredRender' ) }
20
+ />
13
21
< p > { 42 } !</ p >
14
- < p > C: < Counter /> </ p >
15
- < p > A1: < Async /> </ p >
16
- < p > A2: < Async2 /> </ p >
17
- < p > P: < Portal /> </ p >
18
- { Date . now ( ) < 0 && < ShouldNotBeImported /> }
22
+ < p > C: < Counter /> </ p >
23
+ < p > A1: < Async /> </ p >
24
+ < p > A2: < Async2 /> </ p >
25
+ < p > P: < Portal /> </ p >
26
+ { Date . now ( ) < 0 && < ShouldNotBeImported /> }
19
27
</ h1 >
20
28
)
21
29
22
- setConfig ( { logLevel : 'debug' } )
30
+ setConfig ( { logLevel : 'debug' } )
23
31
24
32
export default hot ( module ) ( App )
You can’t perform that action at this time.
0 commit comments