File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
import identity from 'lodash/utility/identity' ;
2
2
import shallowEqual from '../utils/shallowEqual' ;
3
3
import isPlainObject from 'lodash/lang/isPlainObject' ;
4
+ import invariant from 'invariant' ;
4
5
5
6
export default function createConnector ( React ) {
6
7
const { Component, PropTypes } = React ;
@@ -61,9 +62,11 @@ export default function createConnector(React) {
61
62
const state = context . redux . getState ( ) ;
62
63
const slice = props . select ( state ) ;
63
64
64
- if ( ! isPlainObject ( slice ) ) {
65
- throw new Error ( 'prop `select` should always return an object' ) ;
66
- }
65
+ invariant (
66
+ isPlainObject ( slice ) ,
67
+ 'The return value of `select` prop must be an object. Instead received %s.' ,
68
+ slice
69
+ ) ;
67
70
68
71
return { slice } ;
69
72
}
You can’t perform that action at this time.
0 commit comments