Click to change the variable in react, why does it not work?

it is clear that the value of the variable has changed, why does the text on the page not change?

Mar.18,2021

this.setState({like: !this.state.like})

setState before render, changes state directly will not render again


after changing the state, it is useless to call the render method. You need to use this sentence:

  

changes to state in react need to use the setState method to ensure that ui and state maintain Synchronize. This is the most basic react common sense-copy~, read more documents

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