From 56c829bfad227ac8c096610e089871d231bf89ea Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Wed, 15 May 2019 13:36:33 +0200 Subject: [PATCH] fix(react-router): Allow string and object refs in withRouter (#6680) * fix(react-router): Don't warn about ref objects * fix(react-router): Don't warn about string refs --- packages/react-router/modules/withRouter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-router/modules/withRouter.js b/packages/react-router/modules/withRouter.js index 86b64233a6..073aeec40c 100644 --- a/packages/react-router/modules/withRouter.js +++ b/packages/react-router/modules/withRouter.js @@ -36,7 +36,11 @@ function withRouter(Component) { if (__DEV__) { C.propTypes = { - wrappedComponentRef: PropTypes.func + wrappedComponentRef: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.func, + PropTypes.object + ]) }; }