From 343a70d6ce9bfa03e46309676e0b315ecb0042be Mon Sep 17 00:00:00 2001 From: Sunil Pai Date: Fri, 11 Jan 2019 14:59:49 +0000 Subject: [PATCH] warn when it looks like you haven't updated react-dom fixes #2402 --- packages/react/src/ReactHooks.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react/src/ReactHooks.js b/packages/react/src/ReactHooks.js index e5fa9d3a507..c1802e217d5 100644 --- a/packages/react/src/ReactHooks.js +++ b/packages/react/src/ReactHooks.js @@ -19,6 +19,13 @@ function resolveDispatcher() { dispatcher !== null, 'Hooks can only be called inside the body of a function component.', ); + if (__DEV__) { + warning( + typeof dispatcher.useState === 'function', + "It looks like you're using an older version of your renderer, " + + "make sure you've updated both react and react- in your package.json", + ); + } return dispatcher; }