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

Function withModal

specs/helper.js:239–256  ·  view source on GitHub ↗
(props, children, test = noop)

Source from the content-addressed store, hash-verified

237 *
238 */
239export const withModal = function(props, children, test = noop) {
240 return withElementCollector(() => {
241 const node = createHTMLElement();
242 const modalProps = { ariaHideApp: false, ...props };
243 let modal;
244 try {
245 ReactDOM.render(
246 <Modal ref={m => (modal = m)} {...modalProps}>
247 {children}
248 </Modal>,
249 node
250 );
251 test(modal);
252 } finally {
253 ReactDOM.unmountComponentAtNode(node);
254 }
255 });
256};

Callers 4

Modal.spec.jsFile · 0.90

Calls 3

withElementCollectorFunction · 0.85
createHTMLElementFunction · 0.70
renderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…