Pages switch back and forth in antd, setState reports an error

error message is
Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.

The

step is:
there are two pages, an and b, which are table, of antd and render a button in column

<a key={"btn-delete"}  onClick={() => {
    this.setState({    
        b: Date.now()
    })
}}></a>

if you use this.props.history.push ("/ b") to jump to b, and then use this.props.history.push ("/ a") to jump to a, click Delete at this time, you will report this error, but if you refresh the page, you will not report an error.

seek the great god

Mar.03,2021
The hint of

is obvious, but there is no problem with your code.


your code has omitted the key part, this deletion should have a network asynchronous request. When the page is unloaded, execute setState and of course report an error

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