Перепиши этот компонент на функциональный:
/* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-tabindex,jsx-a11y/no-static-element-interactions,react/require-default-props,react/forbid-prop-types */
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import ReactDOM from 'react-dom';
import './Modal.css';
import Grid from "@sber-site/sbercraft-nova-kit/composite/Grid";
import Row from "@sber-site/sbercraft-nova-kit/composite/Grid/Row";
import Col from "@sber-site/sbercraft-nova-kit/composite/Grid/Col";
import prefixAria from "./lib/prefixAria";
import block from "bem-cn/dist/bem-cn";
import {KEYBOARD_CODES} from "@sber-site/sbercraft-nova-kit/lib/keyboard";

const cn = block('modal');

const openModals = [];
let overflowY;
let paddingRight;

export default class Modal extends PureComponent {
    /* eslint-disable no-unused-vars */
    static defaultProps = {
        className: '',
        onClose: event => {},
        windowAria: {},
        iconAria: {},
        padding: true,
        withIcon: true,
        paddingPreset: 'standard',
        overlayBlurred: false,
    };
    /* eslint-enable no-unused-vars */

    constructor(props) {
        super(props);
        this.modal = document.createElement('div');
        this.page = (
            document.getElementById('main') ||
            document.getElementById('app') ||
            document.getElementById('react-app')
        );
    }

    componentDidMount() {
        document.body.appendChild(this.modal);
        // Сохраняем состояние окна до открытия первой модалки.
        if (!openModals.length) {
            ({ overflowY, paddingRight } = document.body.style);
            ({ overflowY } = document.body.style);
            const { offsetWidth } = document.body;
            const { innerWidth } = window;
            document.body.style.overflowY = 'hidden';
            if (offsetWidth !== innerWidth) {
                // Чтобы компенсировать отсутствие скролла.
                document.body.style.paddingRight = `${innerWidth - offsetWidth}px`;
            }
        }
        document.addEventListener('keydown', this.handleDocumentKeydown);
        this.activeElement = document.activeElement;
        if (this.icon) {
            this.icon.focus();
        }
        openModals.push(this.modal);
    }

    componentWillUnmount() {
        document.body.removeChild(this.modal);
        openModals.splice(openModals.indexOf(this.modal), 1);
        if (!openModals.length) {
            document.body.style.overflowY = overflowY;
            document.body.style.paddingRight = paddingRight;
        }
        document.removeEventListener('keydown', this.handleDocumentKeydown);
        if (this.activeElement) {
            this.activeElement.focus();
        }
    }

    render() {
        const {
            className,
            padding,
            onClose,
            xs,
            sm,
            md,
            lg,
            xl,
            children,
            windowAria,
            iconAria,
            overlayBlurred,
            withIcon,
            paddingPreset,
            ...restProps
        } = this.props;

        return ReactDOM.createPortal(
            (
                <div
                    {...restProps}
                    className={cn({}, className)}
                >
                    <div
                        className={cn('overlay', { blurred: overlayBlurred })}
                        onMouseDown={() => this.handleOverlayClick}
                    >
                        <Grid
                            fixed={true}
                            className={cn('grid')}
                        >
                            <Row className={cn('row')}>
                                <Col
                                    xs={xs}
                                    sm={sm}
                                    md={md}
                                    lg={lg}
                                    xl={xl}
                                    className={cn('col')}
                                >
                                    <div
                                        role="dialog"
                                        className={cn('window', {
                                            padding,
                                            paddingPreset: padding ? paddingPreset : false,
                                        })}
                                        ref={window1 => { this.window = window1; }}
                                        {...prefixAria(windowAria)}
                                    >
                                        {withIcon && (
                                            <i
                                                className={cn('icon')}
                                                onClick={() => onClose}
                                                ref={icon => { this.icon = icon; }}
                                                tabIndex={0}
                                                onKeyDown={() => this.handleIconKeyDown}
                                                role="button"
                                                {...prefixAria(iconAria)}
                                            />
                                        )}
                                        <Grid
                                            xs={xs}
                                            sm={sm}
                                            md={md}
                                            lg={lg}
                                            xl={xl}
                                            className={cn('body')}
                                        >
                                            {children}
                                        </Grid>
                                    </div>
                                </Col>
                            </Row>
                        </Grid>
                    </div>
                </div>
            ),
            this.modal
        );
    }

    handleOverlayClick = event => {
        if (this.window && !this.props.noOverlayClose) {
            const rect = this.window.getBoundingClientRect();
            const { clientX, clientY } = event;

            let isClickOverlay = false;
            const elem = document.elementFromPoint(clientX, clientY).className;

            if (/kitt-modal__row/.test(elem) || /kitt-modal__overlay/.test(elem) || /kitt-modal__grid/.test(elem)
                || /kitt-modal__col/.test(elem)) {
                isClickOverlay = true;
            }

            if (clientX === 0 && clientY === 0 || !isClickOverlay) {
                // то это скринридер, который нажал клик через клавиатуру и не нужно закрывать модалку
                return false;
            }

            if (clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom) {
                this.props.onClose();
            }
        }
    };

    handleDocumentKeydown = event => {
        switch (event.which) {
            case KEYBOARD_CODES.Escape:
                if (openModals[openModals.length - 1] === this.modal) {
                    event.stopImmediatePropagation();
                    event.stopPropagation();
                    this.props.onClose(event);
                }
                break;
            default:
                break;
        }
    };

    handleIconKeyDown = event => {
        switch (event.which) {
            case KEYBOARD_CODES.Enter:
            case KEYBOARD_CODES.Space:
                event.preventDefault();
                this.props.onClose(event);
                break;
            default:
                break;
        }
    }
}