MCPcopy Create free account
hub / github.com/ElemeFE/element-react / next

Function next

src/message-box/index.js:51–72  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

49}
50
51function next(props) {
52 return new Promise((resolve, reject) => {
53 const div = document.createElement('div');
54
55 document.body.appendChild(div);
56
57 if (props.lockScroll != false) {
58 document.body.style.setProperty('overflow', 'hidden');
59 }
60
61 const component = React.createElement(MessageBox, Object.assign({}, props, {
62 promise: { resolve, reject },
63 willUnmount: () => {
64 ReactDOM.unmountComponentAtNode(div);
65 document.body.removeChild(div);
66 document.body.style.removeProperty('overflow');
67 }
68 }));
69
70 ReactDOM.render(component, div);
71 });
72}
73
74export default {
75 alert,

Callers 4

alertFunction · 0.85
confirmFunction · 0.85
promptFunction · 0.85
msgboxFunction · 0.85

Calls 2

removeChildMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected