React setState status change

  addEditChange(e,key){
        let that = this;
        let add_edit_form = that.state.add_edit_form;
            add_edit_form[key] = e.target.value;
        that.setState({
            add_edit_form:add_edit_form
        })
        console.log(that.state.budget_form);
    }
    
    
     setState  add_edit_form  budget_form
    
Mar.02,2021

is your budget_form add_edit_form


console.log(that.state.budget_form);  
that.setState({
            add_edit_form:add_edit_form
},()=>{
 console.log(that.state.budget_form);    
})

see if the print is the same


typical shallow copy and deep copy (somewhere add_edit_form equals budget_form), if you want to change it, you'd better use

.
import update from 'react-addons-update';

...

const add_edit_form = update(budget_form, {a: {$set: 'b'}})
//
const add_edit_form = update(this.state.add_edit_form, {a: {$set: 'b'}})
//add_edit_formreference

this.setState({add_edit_form})
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-1e44994-44ab7.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-1e44994-44ab7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?