From fc01d579ad24d03229830c7196dc7318be0f9342 Mon Sep 17 00:00:00 2001 From: PSpSynedra Date: Tue, 18 Aug 2015 11:09:56 +0200 Subject: [PATCH] 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. --- src/components/createProvider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/createProvider.js b/src/components/createProvider.js index 030c8e2ac..e0f407eb1 100644 --- a/src/components/createProvider.js +++ b/src/components/createProvider.js @@ -10,7 +10,8 @@ export default function createProvider(React) { }; static propTypes = { - children: PropTypes.func.isRequired + children: PropTypes.func.isRequired, + store: storeShape.isRequired }; getChildContext() {