import { withRouter } from "https://deno.land/x/aleph@v0.3.0-alpha.17/react.ts";
withRouter
allows you to use useRouter
hook with class component.
class MyComponent extends React.Component {
render() {
return <p>{this.props.router.pathname}</p>
}
}
export default withRouter(MyComponent)
Parameters
Component: ComponentType<P>