React loading style causes echarts width calculation error?

  1. has the following react components:
import "./Home.scss";

class Home extends React.Component{
    render(){
        return (
            <div className="box clearfix">
                <div className="left">
                    <Echart style={{width: "100%", height: 300}} .../>
                </div>
                <div className="right">
                    <Echart style={{width: "100%", height: 300}} .../>
                </div>
            </div>
        );
    }
}

.left , .right each 50% , but the width of the Echarts is indeed 100% when rendering. If I write the style in the line, there will be no problem

.
//Home.scss
.box{
    .left, .right{
        width: "50%";
        float: left;
    }
}

so it seems that the style is not loaded when rendering Echarts, so at the beginning, the width of both left and right is 100%. How to solve this problem?


my solution uses setTimeout (() = > {Code});

part of the code is as follows

setTimeout(() => {
      let ele = document.getElementById(`chart-line-container${type}`);
      let myChart = echarts.init(ele);
      myChart.showLoading({
        text: '...',    //loading
      });
      
}, 0);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e94a36-4e9c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e94a36-4e9c0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?