MCPcopy
hub / github.com/reactjs/react-modal / componentDidMount

Method componentDidMount

src/components/Modal.js:131–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 };
130
131 componentDidMount() {
132 if (!canUseDOM) return;
133
134 if (!isReact16) {
135 this.node = createHTMLElement("div");
136 }
137 this.node.className = this.props.portalClassName;
138
139 const parent = getParentElement(this.props.parentSelector);
140 parent.appendChild(this.node);
141
142 !isReact16 && this.renderPortal(this.props);
143 }
144
145 getSnapshotBeforeUpdate(prevProps) {
146 const prevParent = getParentElement(prevProps.parentSelector);

Callers

nothing calls this directly

Calls 2

getParentElementFunction · 0.85
createHTMLElementFunction · 0.70

Tested by

no test coverage detected