How can objects defined by react in componentDidMount be used in other submissions such as handleSubmit?


class Demo extends Component {
    handleSubmit = () => {
        //  chart 
    
    }
    componentDidMount() {
        // 
        var chart = new G2.Chart({
             container: "dashboardChange",
             forceFit: true,
        });
    }
    }
Apr.23,2021

can't you just write like this


this.chart = {...}

then you can get this.chart globally

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-1b38a48-2c13b.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-1b38a48-2c13b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?