Created
February 22, 2024 22:11
-
-
Save johnpolacek/1266f534a4b3559b14af65029bc1fc80 to your computer and use it in GitHub Desktop.
Utility React Tailwind Component for printing an object to the screen for building and debugging
This file contains 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
import React from "react" | |
const PrintObject: React.FC<{ object: Record<string, unknown> }> = ({ object }) => { | |
return ( | |
<pre className="w-full max-w-5xl overflow-scroll text-sm border bg-black text-white rounded p-2 "> | |
<code>{JSON.stringify(object, null, 2)}</code> | |
</pre> | |
) | |
} | |
export default PrintObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment