diff --git a/src/components/Charts/Radar/index.js b/src/components/Charts/Radar/index.js index 64c51a65b3728d67fae584b75f7f64615bad5722..a2e44ddbdc8a3bc4287540fcab45f21ea248ca44 100644 --- a/src/components/Charts/Radar/index.js +++ b/src/components/Charts/Radar/index.js @@ -12,9 +12,7 @@ export default class Radar extends Component { }; componentDidMount() { - requestAnimationFrame(() => { - this.getLegendData(); - }); + this.getLegendData(); } componentDidUpdate(preProps) { diff --git a/src/components/Charts/WaterWave/index.js b/src/components/Charts/WaterWave/index.js index ce4530c066b8f8814da77a2c110934267e98538a..66f28adf37e4558a0d0d147ce06a2fdfdcb9fb9d 100644 --- a/src/components/Charts/WaterWave/index.js +++ b/src/components/Charts/WaterWave/index.js @@ -13,10 +13,8 @@ export default class WaterWave extends PureComponent { }; componentDidMount() { - requestAnimationFrame(() => { - this.renderChart(); - this.resize(); - }); + this.renderChart(); + this.resize(); window.addEventListener( 'resize', () => { diff --git a/src/routes/Profile/AdvancedProfile.js b/src/routes/Profile/AdvancedProfile.js index 5289b6771058859ddfe7cee753e45d5f4e4a9e97..8591d8303f6b5394c02a85f1d70196a208cdbbca 100644 --- a/src/routes/Profile/AdvancedProfile.js +++ b/src/routes/Profile/AdvancedProfile.js @@ -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() {