Skip to content

Commit 56c829b

Browse files
eps1lontimdorr
authored andcommittedMay 15, 2019
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
1 parent aeccaeb commit 56c829b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎packages/react-router/modules/withRouter.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ function withRouter(Component) {
3636

3737
if (__DEV__) {
3838
C.propTypes = {
39-
wrappedComponentRef: PropTypes.func
39+
wrappedComponentRef: PropTypes.oneOfType([
40+
PropTypes.string,
41+
PropTypes.func,
42+
PropTypes.object
43+
])
4044
};
4145
}
4246

0 commit comments

Comments
 (0)
Please sign in to comment.