Commit 868f84a6 authored by 陈帅's avatar 陈帅

delete some no no needrequestAnimationFrame

parent 8e3050ae
...@@ -12,9 +12,7 @@ export default class Radar extends Component { ...@@ -12,9 +12,7 @@ export default class Radar extends Component {
}; };
componentDidMount() { componentDidMount() {
requestAnimationFrame(() => { this.getLegendData();
this.getLegendData();
});
} }
componentDidUpdate(preProps) { componentDidUpdate(preProps) {
......
...@@ -13,10 +13,8 @@ export default class WaterWave extends PureComponent { ...@@ -13,10 +13,8 @@ export default class WaterWave extends PureComponent {
}; };
componentDidMount() { componentDidMount() {
requestAnimationFrame(() => { this.renderChart();
this.renderChart(); this.resize();
this.resize();
});
window.addEventListener( window.addEventListener(
'resize', 'resize',
() => { () => {
......
...@@ -212,19 +212,17 @@ export default class AdvancedProfile extends Component { ...@@ -212,19 +212,17 @@ export default class AdvancedProfile extends Component {
@Bind() @Bind()
@Debounce(200) @Debounce(200)
setStepDirection() { setStepDirection() {
requestAnimationFrame(() => { const { stepDirection } = this.state;
const { stepDirection } = this.state; const w = getWindowWidth();
const w = getWindowWidth(); if (stepDirection !== 'vertical' && w <= 576) {
if (stepDirection !== 'vertical' && w <= 576) { this.setState({
this.setState({ stepDirection: 'vertical',
stepDirection: 'vertical', });
}); } else if (stepDirection !== 'horizontal' && w > 576) {
} else if (stepDirection !== 'horizontal' && w > 576) { this.setState({
this.setState({ stepDirection: 'horizontal',
stepDirection: 'horizontal', });
}); }
}
});
} }
render() { render() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment