Skip to content

Commit fc01d57

Browse files
committed
Enforce shape of store property
This produce better Error messages, when store property is not being provided. In our case we migrated to redux-1.0.x and got the waring: "Warning: Failed Context Types: Required child context `store` was not specified in `Provider`" because previously the property holding the flux instance was named redux. With the propTypes specified you would get the following warning: "Warning: Failed propType: Required prop `store` was not specified in `Provider`" which makes it pretty clear how and where to fix the issue.
1 parent cc97853 commit fc01d57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/createProvider.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export default function createProvider(React) {
1010
};
1111

1212
static propTypes = {
13-
children: PropTypes.func.isRequired
13+
children: PropTypes.func.isRequired,
14+
store: storeShape.isRequired
1415
};
1516

1617
getChildContext() {

0 commit comments

Comments
 (0)