React,this.setState data update

after I update the value of currentType in this method, I use currentType as a parameter to adjust the interface in the fetchQuestionIdList function, but each time currentType is the value I updated last time. Choose 2 to transmit 1, 3 to transmit 2, and 4 to transmit 3.
is there any way to solve this delay? Or should I not have used it as a parameter in this way, but defined other variables to hold the value of my choice? Is this.setState just for re-rendering?

 onClickItemType=(item)=>{
    this.setState({
        currentType:{
            code:item.code,
            name:item.name
        },
        isShowTypeList: false
    })
    this.fetchQuestionIdList(this.state.navigationCode)
}

fetchQuestionIdList = async (tfcode) => {
    let params = {
        navigationCode: tfcode,
        typeCode: currentType.code,
        diffCode: currentDiff.code,
        contentFinalFlag: true,
        thirdpartyType: 1
    }
    let systemQuestions = await matchExcerciseApi.getQuestionList(params) || {}
}
Mar.30,2021

The second parameter passed by

this.setState is a callback function, so state is the updated

.
  

this.setState is executed asynchronously, and you need to get the updated value in its callback function.

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