Last active
October 26, 2022 08:29
-
-
Save hi-ogawa/4fa386de926777d4f7ac3997af346e42 to your computer and use it in GitHub Desktop.
Quick-and-dirty UI debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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