How to use the react-modal.defaultProps function in react-modal

To help you get started, we’ve selected a few react-modal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cncjs / cncjs / src / web / components / Modal / Modal.jsx View on Github external
bsSize: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),

        // When 'true' the modal will show itself.
        show: PropTypes.bool,

        // Specify 'static' for a backdrop that doesn't trigger an "onHide" when clicked.
        backdrop: PropTypes.oneOf(['static', true, false]),

        // Specify whether the Component should contain a close button
        closeButton: PropTypes.bool,

        // A callback fired when the header closeButton or non-static backdrop is clicked.
        onHide: PropTypes.func
    };
    static defaultProps = {
        ...ModalOverlay.defaultProps,
        bsSize: 'xs',
        show: true,
        backdrop: 'static',
        closeButton: true,
        onHide: noop
    };

    style = {
        overflowY: ''
    };

    componentDidMount() {
        this.style.overflowY = document.body.style.overflowY;
        document.body.style.overflowY = 'hidden'; // prevent body scrolling
    }
    componentWillUnmount() {