chore(code/frontend): refactor Route component (#40500) (#40734)

This commit is contained in:
WangQianliang 2019-07-10 21:42:23 +08:00 committed by GitHub
parent 8272ee7890
commit 004572cab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,11 +10,12 @@ import { Match, routeChange } from '../actions';
interface Props extends RouteProps {
routeChange: (match: Match) => void;
computedMatch?: any;
}
class CSRoute extends ReactRoute<Props> {
// eslint-disable-next-line @typescript-eslint/camelcase
public UNSAFE_componentWillMount() {
this.props.routeChange({ ...this.state.match, location: this.props.location });
constructor(props: Props, context: any) {
super(props, context);
props.routeChange({ ...props.computedMatch, location: props.location });
}
public componentDidUpdate() {