How React setState deletes an attribute

problem description

if our state is an object {}, because setState is a merge operation, how should I setState if I want to delete an attribute in state?

the environmental background of the problems and what methods you have tried

has tried to assign values directly, but this is not good

Jul.22,2021

  
  1. can be set to null
  2. you can think about whether you need to delete this property and replace it with other values, such as isShow to hide and not render a component.
Menu