I have react component called overlay :
function Overlay({ isOpen }) {
if (!isOpen) return null;
return (
<div
style={{
background: "rgba(0,0,0,.7)",
position: "fixed",
zIndex: 1,
top: "0",
right: "0",
bottom: "0",
left: "0",
}}
></div>
);
}
It gets a prop called isOpen to show itself or hide . The problem is that it appears and disappears suddenly and I want it to have some kind of transition like 1second so it has an animation of appearing and disappearing .
How can I apply transition animation to this component ?