docs: create Docusaurus v2.4.0 release docs + changelog + release blog post (#8811)

This commit is contained in:
Sébastien Lorber 2023-03-23 19:32:09 +01:00 committed by GitHub
parent da9f86409d
commit 97caab16d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 19157 additions and 22 deletions

View file

@ -9,15 +9,24 @@ import React, {type ReactNode, useState} from 'react';
export default function ErrorBoundaryTestButton({
children = 'Boom!',
message = 'Boom!\nSomething bad happened, but you can try again!',
cause,
}: {
children?: ReactNode;
message?: string;
cause?: string;
}): JSX.Element {
const [state, setState] = useState(false);
if (state) {
throw new Error('Boom!\nSomething bad happened, but you can try again!');
throw new Error(message, {
cause: cause ? new Error(cause) : undefined,
});
}
return (
<button type="button" onClick={() => setState(true)}>
<button
className="button button--danger"
type="button"
onClick={() => setState(true)}>
{children}
</button>
);