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

delete some no no needrequestAnimationFrame

parent 8e3050ae
......@@ -12,9 +12,7 @@ export default class Radar extends Component {
};
componentDidMount() {
requestAnimationFrame(() => {
this.getLegendData();
});
this.getLegendData();
}
componentDidUpdate(preProps) {
......
......@@ -13,10 +13,8 @@ export default class WaterWave extends PureComponent {
};
componentDidMount() {
requestAnimationFrame(() => {
this.renderChart();
this.resize();
});
this.renderChart();
this.resize();
window.addEventListener(
'resize',
() => {
......
......@@ -212,19 +212,17 @@ export default class AdvancedProfile extends Component {
@Bind()
@Debounce(200)
setStepDirection() {
requestAnimationFrame(() => {
const { stepDirection } = this.state;
const w = getWindowWidth();
if (stepDirection !== 'vertical' && w <= 576) {
this.setState({
stepDirection: 'vertical',
});
} else if (stepDirection !== 'horizontal' && w > 576) {
this.setState({
stepDirection: 'horizontal',
});
}
});
const { stepDirection } = this.state;
const w = getWindowWidth();
if (stepDirection !== 'vertical' && w <= 576) {
this.setState({
stepDirection: 'vertical',
});
} else if (stepDirection !== 'horizontal' && w > 576) {
this.setState({
stepDirection: 'horizontal',
});
}
}
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