How to do animation in react, simple, pop-up box change opacity gradually display

background:

<div 
    className="company-detail"
    style={{display:this.state.cd_show ? "block" : "none"}}
>
    ...
</div>

this is a pop-up window
used to change the state control display, as above; now 1. I think it"s too stiff. When you click on a different nodes, the content in the pop-up window is adjusted to get the interface, and the user can see the changing process of the content.
question:
to sum up, now you want to make it overdisplay when the pop-up window is displayed (opacity from 0 to 1), and you can just display:none when you hide it.

Mar.23,2021

there are 2 simple methods:

  1. use Animation Add-Ons, official document .
  2. make use of the CSS3 attribute: transition:all .2s ease; (recommended, simple and rude)
.comp {
    opacity: 0;
    transition:all .2s ease;
    &.show {
        opacity: 1;
    }
}
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-1eb5641-69cc1.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-1eb5641-69cc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?