MCPcopy Index your code
hub / github.com/reactjs/react-modal / render

Method render

examples/basic/simple_usage/index.js:55–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 }
54
55 render() {
56 const { currentModal } = this.state;
57
58 return (
59 <div>
60 <button type="button" className="btn btn-primary" onClick={this.toggleModal(MODAL_A)}>Open Modal A</button>
61 <button type="button" className="btn btn-primary" onClick={this.toggleModal(MODAL_B)}>Open Modal B</button>
62 <MyModal
63 title={this.state.title1}
64 isOpen={currentModal == MODAL_A}
65 onAfterOpen={this.handleOnAfterOpenModal}
66 onRequestClose={this.handleModalCloseRequest}
67 askToClose={this.toggleModal(MODAL_A)}
68 onChangeInput={this.handleInputChange} />
69 <Modal
70 ref="mymodal2"
71 id="test2"
72 aria={{
73 labelledby: "heading",
74 describedby: "fulldescription"
75 }}
76 closeTimeoutMS={150}
77 contentLabel="modalB"
78 isOpen={currentModal == MODAL_B}
79 shouldCloseOnOverlayClick={false}
80 onAfterOpen={this.handleOnAfterOpenModal}
81 onRequestClose={this.toggleModal(MODAL_B)}>
82 <h1 id="heading" ref={h1 => this.heading = h1}>This is the modal 2!</h1>
83 <div id="fulldescription" tabIndex="0" role="document">
84 <p>This is a description of what it does: nothing :)</p>
85 <button onClick={this.toggleModal(MODAL_B)}>close</button>
86 </div>
87 </Modal>
88 </div>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected