16 lines
287 B
TypeScript
16 lines
287 B
TypeScript
|
export default function CreateError() {
|
||
|
return (
|
||
|
<div>
|
||
|
<button
|
||
|
onClick={() => {
|
||
|
if (window.confirm('Cause an error?')) {
|
||
|
throw Error('You caused an error!')
|
||
|
}
|
||
|
}}
|
||
|
>
|
||
|
Create an Error
|
||
|
</button>
|
||
|
</div>
|
||
|
)
|
||
|
}
|