import { Component } from 'react';
import { RouteComponentProps, withRouter } from 'react-router-class-tools';
@withRouter
export class PageWithRouterDecorator extends Component<RouteComponentProps> {
render() {
const { location, match, query } = this.props;
return (
<pre>{JSON.stringify({ location, match, query }, null, 4)}</pre>
);
}
}
import { Component } from 'react';
import { RouteComponentProps, withRouter } from 'react-router-class-tools';
export default withRouter(class PageWithRouterFunction extends Component<RouteComponentProps> {
render() {
const { location, match, query } = this.props;
return (
<pre>{JSON.stringify({ location, match, query }, null, 4)}</pre>
);
}
}
Value of the parent Context specified in
contextType.