We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a child component rendered from a loop throws, subsequent errors are not caught by the error boundary.
Sandbox here
preact ^10.0.0-beta.0:
^10.0.0-beta.0
import { render, h, Component } from "preact"; let throws = 0; const Child = () => { console.log(`child throwing (${++throws})`); throw new Error("oi!"); }; class TopErrorBoundary extends Component { state = { error: false } __renders = 0; static getDerivedStateFromError (error, info) { console.log(`getDerivedStateFromError called`); return { error: true }; } render () { console.log(`TopErrorBoundary render()`, this.state); return this.state.error ? <h1>Something went wrong.</h1> : this.props.children; } } render( <TopErrorBoundary> <div> {/* CHANGE THIS ARRAY TO LENGTH: 1 FOR THE ERROR BOUNDARY TO WORK */} {[1, 2].map(() => { return <Child />; })} </div> </TopErrorBoundary>, document.body );
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When a child component rendered from a loop throws, subsequent errors are not caught by the error boundary.
Sandbox here
preact
^10.0.0-beta.0
:The text was updated successfully, but these errors were encountered: