| 768 | let modal = null; |
| 769 | |
| 770 | class App extends Component { |
| 771 | constructor(props) { |
| 772 | super(props); |
| 773 | this.state = { classModifier: "" }; |
| 774 | } |
| 775 | |
| 776 | componentDidMount() { |
| 777 | modal.node.className.should.be.eql("portal"); |
| 778 | |
| 779 | this.setState({ classModifier: "-modifier" }); |
| 780 | } |
| 781 | |
| 782 | componentDidUpdate() { |
| 783 | modal.node.className.should.be.eql("portal-modifier"); |
| 784 | } |
| 785 | |
| 786 | render() { |
| 787 | const { classModifier } = this.state; |
| 788 | const portalClassName = `portal${classModifier}`; |
| 789 | |
| 790 | return ( |
| 791 | <div> |
| 792 | <Modal |
| 793 | ref={modalComponent => { |
| 794 | modal = modalComponent; |
| 795 | }} |
| 796 | isOpen |
| 797 | portalClassName={portalClassName} |
| 798 | > |
| 799 | <span>Test</span> |
| 800 | </Modal> |
| 801 | </div> |
| 802 | ); |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | Modal.setAppElement(node); |
| 807 | ReactDOM.render(<App />, node); |
nothing calls this directly
no outgoing calls
no test coverage detected