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 1111 "babel-plugin-transform-class-properties" : " ^6.24.1" ,
1212 "babel-preset-env" : " ^1.6.1" ,
1313 "babel-preset-react" : " ^6.24.1" ,
14+ "flow-bin" : " ^0.74.0" ,
1415 "html-webpack-plugin" : " ^3.2.0" ,
1516 "webpack" : " ^4.9.1" ,
1617 "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'
23import * as React from 'react'
34import Counter from './Counter'
4- import imported from 'react-imported-component'
5+ import imported , { ComponentLoader } from 'react-imported-component'
56import Portal from './Portal'
67
8+ imported ( ( ) => import ( /* webpackChunkName: "namedChunk-1" */ './DeferredRender' ) , {
9+ async : true
10+ } ) ;
11+
712const Async = imported ( ( ) => import ( /* webpackChunkName: "namedChunk-1" */ './DeferredRender' ) ) ;
813const Async2 = imported ( ( ) => import ( /* webpackChunkName: "namedChunk-2" */ './DeferredRender' ) ) ;
914const ShouldNotBeImported = imported ( ( ) => import ( /* webpackChunkName: "namedChunk-2" */ './NotImported' ) ) ;
1015
1116const App = ( ) => (
1217 < h1 >
18+ < ComponentLoader
19+ loadable = { ( ) => import ( /* webpackChunkName: "namedChunk-1" */ './DeferredRender' ) }
20+ />
1321 < 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 /> }
1927 </ h1 >
2028)
2129
22- setConfig ( { logLevel : 'debug' } )
30+ setConfig ( { logLevel : 'debug' } )
2331
2432export default hot ( module ) ( App )
You can’t perform that action at this time.
0 commit comments