Can the lifecycle function of React be preceded by async?

look at some code that is written like this and can still run, life cycle hook plus async, does not quite understand this behavior, not to say that componentWillMount is Synchronize, execute in front of render, so it will not block?

class Edit extends Component{
    constructor(){
    }
    async componentWillMount(){
        await someMethod();
    }
    render(){
    }
}
Jun.21,2021

adding async can only guarantee Synchronize inside the function

function getData(){
    new Promise((resolve)=>{
        setTimeout(()=>{
            resolve()
        },2000)
    })
}

async function foo(){
  console.log(1)
  await getData()//2
  console.log(2)
}

foo().then(()=>{})
console.log(3)

// 1 3
// 
// 2

foo external or a normal Promise function only ensures that its interior is Synchronize


of course, you can add it. After adding async/await, the asynchronous operation in the lifecycle function is Synchronize, but it does not affect the lifecycle itself. For example, your code still does not execute render () until componentWillMount () is finished.

add: asynchronous component loading is realized by using async/await, and dynamic import

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