Update @types/history to the latest version 🚀 (#389)
* chore(package): update @types/history to version 4.6.2 * Rework type to newly added history overrides.
This commit is contained in:
parent
2451f817d4
commit
6da5fac1d1
|
@ -1,13 +1,7 @@
|
|||
import React from 'react';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import Modal, { IButton } from 'components/ui/Modal';
|
||||
import { Location, History as H } from 'history';
|
||||
|
||||
type UnregisterCallback = () => void;
|
||||
type BooleanCallback = (arg?: any) => boolean;
|
||||
interface History extends H {
|
||||
block(prompt?: boolean | BooleanCallback): UnregisterCallback;
|
||||
}
|
||||
import { Location, History } from 'history';
|
||||
|
||||
interface Props {
|
||||
when: boolean;
|
||||
|
@ -50,7 +44,9 @@ class NavigationPrompt extends React.Component<Props, State> {
|
|||
nextLocation
|
||||
});
|
||||
}
|
||||
return !this.props.when;
|
||||
if (this.props.when) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/classnames": "2.2.3",
|
||||
"@types/history": "4.6.1",
|
||||
"@types/history": "4.6.2",
|
||||
"@types/jest": "21.1.8",
|
||||
"@types/lodash": "4.14.86",
|
||||
"@types/qrcode": "0.8.0",
|
||||
|
|
Loading…
Reference in New Issue