I am creating side drawer using CSSTransition group it working fine but time delay in opening and closing drawer is very fast.
import React from "react";
import ReactDOM from "react-dom";
import { CSSTransition } from "react-transition-group";
import "./SideDrawer.css";
const SideDrawer = (props) => {
const content = (
<CSSTransition
in={props.show}
timeout={300}
classNames="let"
unmountOnExit
mountOnEnter
>
<aside className="sidedrawer" onClick={props.onClick}>
{props.children}
</aside>
</CSSTransition>
);
return ReactDOM.createPortal(content, document.getElementById("drawer-hook"));
};
export default SideDrawer;
Sidedrawer.css
.sidedrawer {
position: fixed;
left: 0;
top: 0;
z-index: 100;
height: 100%;
width: 62%;
background: white;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
}