File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,36 @@ export default function createDevTools(children) {
2424
2525 constructor ( props , context ) {
2626 super ( props , context ) ;
27+
28+ if ( ! props . store && ! context . store ) {
29+ console . error (
30+ `DevTools cannot render because no Redux store was injected via \
31+ props or <Provide>` ) ;
32+ return ;
33+ }
34+
2735 if ( context . store ) {
2836 this . liftedStore = context . store . liftedStore ;
2937 } else {
3038 this . liftedStore = props . store . liftedStore ;
3139 }
40+
41+ if ( ! this . liftedStore ) {
42+ console . error (
43+ `DevTools cannot render because the store not been instrumented \
44+ with DevTools.instrument()` ) ;
45+ }
3246 }
3347
3448 render ( ) {
49+ if ( ! this . liftedStore ) {
50+ return null ;
51+ }
52+
3553 return (
3654 < ConnectedMonitor { ...monitorProps }
3755 store = { this . liftedStore } />
3856 ) ;
3957 }
4058 } ;
4159}
42-
You can’t perform that action at this time.
0 commit comments