Commit d1719b5 1 parent eb60e79 commit d1719b5 Copy full SHA for d1719b5
File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,14 @@ export default class KintoAdmin extends Component {
19
19
plugins : [ ] ,
20
20
}
21
21
22
- componentWillMount ( ) {
23
- const { plugins, settings} = this . props ;
22
+ constructor ( props ) {
23
+ super ( props ) ;
24
+
25
+ const { plugins, settings} = props ;
24
26
this . store = configureStore ( { settings} , plugins ) ;
25
27
syncHistoryWithStore ( hashHistory , this . store ) ;
26
28
29
+ // Restore saved session, if any
27
30
const session = loadSession ( ) ;
28
31
if ( session ) {
29
32
this . store . dispatch ( sessionActions . setup ( session ) ) ;
@@ -33,15 +36,15 @@ export default class KintoAdmin extends Component {
33
36
render ( ) {
34
37
const { store} = this ;
35
38
const { plugins} = this . props ;
36
- const registerPlugins = plugins . map ( plugin => plugin . register ( this . store ) ) ;
39
+ const registerPlugins = plugins . map ( plugin => plugin . register ( store ) ) ;
37
40
38
41
function onRouteUpdate ( ) {
39
42
const { params, location} = this . state ;
40
43
store . dispatch ( routeActions . routeUpdated ( params , location ) ) ;
41
44
}
42
45
43
46
return (
44
- < Provider store = { this . store } >
47
+ < Provider store = { store } >
45
48
< Router history = { hashHistory } onUpdate = { onRouteUpdate } >
46
49
{ getRoutes ( this . store , registerPlugins ) }
47
50
</ Router >
You can’t perform that action at this time.
0 commit comments