We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 527497f commit 98bf0f0Copy full SHA for 98bf0f0
src/components/createConnector.js
@@ -1,6 +1,7 @@
1
import identity from 'lodash/utility/identity';
2
import shallowEqual from '../utils/shallowEqual';
3
import isPlainObject from 'lodash/lang/isPlainObject';
4
+import invariant from 'invariant';
5
6
export default function createConnector(React) {
7
const { Component, PropTypes } = React;
@@ -61,9 +62,11 @@ export default function createConnector(React) {
61
62
const state = context.redux.getState();
63
const slice = props.select(state);
64
- if (!isPlainObject(slice)) {
65
- throw new Error('prop `select` should always return an object');
66
- }
+ invariant(
+ isPlainObject(slice),
67
+ 'The return value of `select` prop must be an object. Instead received %s.',
68
+ slice
69
+ );
70
71
return { slice };
72
}
0 commit comments