We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 16842c2 commit 32265ecCopy full SHA for 32265ec
src/elements/common/routing/withRouterAndRef.js.flow
@@ -5,7 +5,7 @@ import { Route } from 'react-router-dom';
5
// Basically a workaround for the fact that react-router's withRouter cannot forward ref's through
6
// functional components. Use this instead to gain the benefits of withRouter but also ref forwarding
7
export default function withRouterAndRef(Wrapped: React.ComponentType<any>) {
8
- const WithRouterAndRef = React.forwardRef<Object, React.Ref<any>>((props, ref) => (
+ const WithRouterAndRef = React.forwardRef((props: any, ref: React.Ref<any>) => (
9
<Route>{routeProps => <Wrapped ref={ref} {...routeProps} {...props} />}</Route>
10
));
11
const name = Wrapped.displayName || Wrapped.name || 'Component';
0 commit comments