MCPcopy Create free account
hub / github.com/reactstrap/reactstrap / componentDidMount

Function componentDidMount

src/Modal.js:139–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137 }
138
139 componentDidMount() {
140 const { isOpen, autoFocus, onEnter } = this.props;
141
142 if (isOpen) {
143 this.init();
144 this.setState({ isOpen: true });
145 if (autoFocus) {
146 this.setFocus();
147 }
148 }
149
150 if (onEnter) {
151 onEnter();
152 }
153
154 // traps focus inside the Modal, even if the browser address bar is focused
155 document.addEventListener('focus', this.trapFocus, true);
156
157 this._isMounted = true;
158 }
159
160 componentDidUpdate(prevProps, prevState) {
161 if (this.props.isOpen && !prevProps.isOpen) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…