import { Component, StrictMode, useState, type ReactNode } from 'react';
import { createRoot } from 'react-dom/client';
import { ProbeMap } from './ProbeMap';
import './probe.css';
// A probe that white-screens teaches nothing: the run has to say *whose* bug it
// was, ol-ext's or ours. This boundary keeps the error on the page so the gate
// result stays attributable.
class ErrorBoundary extends Component<{ children: ReactNode }, { error: Error | null }> {
state: { error: Error | null } = { error: null };
static getDerivedStateFromError(error: Error) {
return { error };
}
render() {
const { error } = this.state;
if (!error) return this.props.children;
return (
请把下面整段发给我 —— 它决定这次失败算谁的。探针崩溃了
{error.name}: {error.message}
{'\n\n'}
{error.stack}
地图已卸载。重新挂载会构造新的 Map,这是预期行为。
} > ); } createRoot(document.getElementById('probe')!).render(