How react defines state

I happen to see that react has a very strange way of defining component state, which is like this

.
class Hello extends React.Component {
    // 
    constructor() {
        this.state = {
            name: "lan"
        }
    } 
    
    // 
    state = {
        name: "lan"
    }
}

is this the custom use of react (there is no such use of class for es6).

Jun.17,2021

this is the way ESNEXT is written.

escaped
https://babeljs.io/docs/en/ba.

supported by babel

proposal

https://github.com/tc39/propo.


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