АМ
Size: a a a
АМ
S
АМ
C
C
useEffect(() => {
const closeLastModal = (): void => {
const res = modalsProps.slice(0, -1);
setModalsProps(res);
};
const handleKeyUp = (e: KeyboardEvent) => {
e.preventDefault();
if (e.keyCode === 27) {
closeLastModal();
}
};
window.addEventListener("keyup", handleKeyUp);
return () => window.removeEventListener("keyup", handleKeyUp);
}, [modalsProps]);
C
C
D
А
М
C
S
М
S
VK
Т
М
Д
А
AV