MCPcopy
hub / github.com/facebook/react / onError

Function onError

packages/react-devtools-core/src/standalone.js:178–204  ·  view source on GitHub ↗
({code, message}: $FlowFixMe)

Source from the content-addressed store, hash-verified

176}
177
178function onError({code, message}: $FlowFixMe) {
179 safeUnmount();
180
181 if (code === 'EADDRINUSE') {
182 node.innerHTML = `
183 <div class="box">
184 <div class="box-header">
185 Another instance of DevTools is running.
186 </div>
187 <div class="box-content">
188 Only one copy of DevTools can be used at a time.
189 </div>
190 </div>
191 `;
192 } else {
193 node.innerHTML = `
194 <div class="box">
195 <div class="box-header">
196 Unknown error
197 </div>
198 <div class="box-content">
199 ${message}
200 </div>
201 </div>
202 `;
203 }
204}
205
206function openProfiler() {
207 // Mocked up bridge and store to allow the DevTools to be rendered

Callers 3

startServerFunction · 0.70
ReactCache-test.jsFile · 0.50

Calls 1

safeUnmountFunction · 0.85

Tested by

no test coverage detected