mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
fix some react deprecation warnings
This commit is contained in:
parent
d3f33b90a6
commit
743b409f7f
@ -12,7 +12,7 @@ describe('Autoscroll', () => {
|
||||
this.state = { vScroll: calcVScroll() }
|
||||
}
|
||||
|
||||
componentWillUpdate() {
|
||||
UNSAFE_componentWillUpdate() {
|
||||
mockFn("foo")
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ describe('Autoscroll', () => {
|
||||
viewport = ReactDOM.findDOMNode(autoScroll)
|
||||
viewport.scrollTop = 10
|
||||
Object.defineProperty(viewport, "scrollHeight", { value: 10, writable: true })
|
||||
autoScroll.componentWillUpdate()
|
||||
autoScroll.UNSAFE_componentWillUpdate()
|
||||
expect(mockFn).toBeCalledWith("foo")
|
||||
|
||||
Object.defineProperty(viewport, "scrollHeight", { value: 0, writable: true })
|
||||
|
@ -14,7 +14,7 @@ export default class FilterDocs extends Component {
|
||||
this.state = { doc: FilterDocs.doc }
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
if (!FilterDocs.xhr) {
|
||||
FilterDocs.xhr = fetchApi('/filter-help').then(response => response.json())
|
||||
FilterDocs.xhr.catch(() => {
|
||||
|
@ -106,7 +106,7 @@ export default class FilterInput extends Component {
|
||||
return (
|
||||
<div className={classnames('filter-input input-group', { 'has-error': !this.isValid() })}>
|
||||
<span className="input-group-addon">
|
||||
<i className={'fa fa-fw fa-' + type} style={{ color }}></i>
|
||||
<i className={'fa fa-fw fa-' + type} style={{ color }}/>
|
||||
</span>
|
||||
<input
|
||||
type="text"
|
||||
@ -123,7 +123,7 @@ export default class FilterInput extends Component {
|
||||
<div className="popover bottom"
|
||||
onMouseEnter={this.onMouseEnter}
|
||||
onMouseLeave={this.onMouseLeave}>
|
||||
<div className="arrow"></div>
|
||||
<div className="arrow"/>
|
||||
<div className="popover-content">
|
||||
{this.getDesc()}
|
||||
</div>
|
||||
|
@ -11,6 +11,7 @@ export default Component => Object.assign(class AutoScrollWrapper extends Compon
|
||||
UNSAFE_componentWillUpdate() {
|
||||
const viewport = ReactDOM.findDOMNode(this);
|
||||
this[symShouldStick] = viewport.scrollTop && isAtBottom(viewport);
|
||||
super.UNSAFE_componentWillUpdate && super.UNSAFE_componentWillUpdate();
|
||||
super.componentWillUpdate && super.componentWillUpdate();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user