For the li tab of dynamic rendering in react, click to switch styles.

as shown below, li is rendered dynamically, and I want to click on it when the background of each li tag turns red. At first, I wanted to add styles by controlling active"s true or false, but this didn"t work. Why clipboard.png

Apr.01,2021

because your li is rendered dynamically, you need to render the click event after rendering. Before li rendering, your click event has already been executed, and you have not added


to your li.

find the problem, go straight to the above picture

clipboard.png
clipboard.png

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