Skip to content

Instantly share code, notes, and snippets.

@johnpolacek
Created February 22, 2024 22:11
Show Gist options
  • Select an option

  • Save johnpolacek/1266f534a4b3559b14af65029bc1fc80 to your computer and use it in GitHub Desktop.

Select an option

Save johnpolacek/1266f534a4b3559b14af65029bc1fc80 to your computer and use it in GitHub Desktop.

Revisions

  1. johnpolacek created this gist Feb 22, 2024.
    11 changes: 11 additions & 0 deletions PrintObject.tsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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