Skip to content

Instantly share code, notes, and snippets.

@hi-ogawa
Last active October 26, 2022 08:29
Show Gist options
  • Save hi-ogawa/4fa386de926777d4f7ac3997af346e42 to your computer and use it in GitHub Desktop.
Save hi-ogawa/4fa386de926777d4f7ac3997af346e42 to your computer and use it in GitHub Desktop.
Quick-and-dirty UI debugging
// @ts-ignore
function Debug(props: { data: any } & JSX.IntrinsicElements["details"]) {
const { data, ...rest } = props;
return (
<details {...rest}>
<summary onClick={() => console.log("debug", data)}>debug</summary>
<pre>{JSON.stringify(data, null, 2)}</pre>
</details>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment