Files
2021-07-01 13:54:54 +02:00

13 lines
321 B
JavaScript

/* eslint-disable no-unused-expressions, no-undef */
let renderCount = 0
export default function Error() {
renderCount++
// Guard to avoid endless loop crashing the browser tab.
if (typeof window !== 'undefined' && renderCount < 3) {
throw new Error('crash')
}
return `error threw ${renderCount} times`
}