import * as React from 'react'; import Modal, { ModalProvider, BaseModalBackground as BackgroundComponent } from 'styled-react-modal'; import styled from 'styled-components'; const background = styled.div` background: rgba(0,0,0,.3); `; // Padding through a custom backgroundComponent const test1 = ( console.log('Background click!')} onEscapeKeydown={() => console.log('Background click!')} afterOpen={() => console.log('After Open!')} afterClose={() => console.log('After Close!')} beforeOpen={() => console.log('Before Open!')} beforeClose={() => console.log('Before Close!')} allowScroll={true} > Modal Content! ); // Passing through the default component const test2 = ( console.log('Background click!')} onEscapeKeydown={() => console.log('Background click!')} afterOpen={() => console.log('After Open!')} afterClose={() => console.log('After Close!')} beforeOpen={() => console.log('Before Open!')} beforeClose={() => console.log('Before Close!')} allowScroll={true} > Modal Content! ); // Minimal Setup const test3 = ( Modal Content! ); const StyledModal = Modal.styled` background: red; `; const test4 = ( console.log('Background click!')}> Modal Content! );