File tree 2 files changed +45
-15
lines changed
2 files changed +45
-15
lines changed Original file line number Diff line number Diff line change 59
59
"postcss-loader" : " ^0.8.0" ,
60
60
"react-addons-test-utils" : " ^0.14.0" ,
61
61
"react-hot-loader" : " ^1.2.9" ,
62
+ "redbox-react" : " ^1.2.2" ,
62
63
"rimraf" : " ^2.4.3" ,
63
64
"sass-loader" : " ^3.1.2" ,
64
65
"style-loader" : " ^0.13.0" ,
Original file line number Diff line number Diff line change 1
- import 'babel-polyfill' ;
2
- import React from 'react' ;
3
- import { render } from 'react-dom' ;
4
- import { Provider } from 'react-redux' ;
5
- import configureStore from './stores' ;
6
- import App from './containers/App' ;
7
-
8
- const store = configureStore ( ) ;
9
-
10
- render (
11
- < Provider store = { store } >
12
- < App />
13
- </ Provider > ,
14
- document . getElementById ( 'app' )
15
- ) ;
1
+ import 'babel-polyfill'
2
+ import React from 'react'
3
+ import ReactDOM from 'react-dom'
4
+ import { Provider } from 'react-redux'
5
+ import configureStore from './stores'
6
+
7
+ const store = configureStore ( )
8
+ const rootEl = document . getElementById ( 'app' )
9
+
10
+ let render = ( ) => {
11
+ const App = require ( './containers/App' ) . default
12
+ ReactDOM . render (
13
+ < Provider store = { store } >
14
+ < App />
15
+ </ Provider > ,
16
+ rootEl
17
+ )
18
+ }
19
+
20
+
21
+ if ( module . hot ) {
22
+ // Support hot reloading of components
23
+ // and display an overlay for runtime errors
24
+ const renderApp = render
25
+ const renderError = ( error ) => {
26
+ const RedBox = require ( 'redbox-react' )
27
+ ReactDOM . render (
28
+ < RedBox error = { error } /> ,
29
+ rootEl
30
+ )
31
+ }
32
+ render = ( ) => {
33
+ try {
34
+ renderApp ( )
35
+ } catch ( error ) {
36
+ renderError ( error )
37
+ }
38
+ }
39
+ module . hot . accept ( './containers/App' , ( ) => {
40
+ setTimeout ( render )
41
+ } )
42
+ }
43
+
44
+ render ( )
You can’t perform that action at this time.
0 commit comments