mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
Implemented strict mode for the project (broken tests, hundreds of @ts-ignore and new errors are included) [skip ci]
This commit is contained in:
committed by
SleepWalker
parent
10e8b77acf
commit
96049ad4ad
@@ -3,16 +3,18 @@ import React from 'react';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { restoreScroll } from './scroll';
|
||||
|
||||
class ScrollIntoView extends React.PureComponent<
|
||||
RouteComponentProps & {
|
||||
top?: boolean; // do not touch any DOM and simply scroll to top on location change
|
||||
}
|
||||
> {
|
||||
interface OwnProps {
|
||||
top?: boolean; // don't touch any DOM and simply scroll to top on location change
|
||||
}
|
||||
|
||||
type Props = RouteComponentProps & OwnProps;
|
||||
|
||||
class ScrollIntoView extends React.PureComponent<Props> {
|
||||
componentDidMount() {
|
||||
this.onPageUpdate();
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
componentDidUpdate(prevProps: Props) {
|
||||
if (this.props.location !== prevProps.location) {
|
||||
this.onPageUpdate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user