Simple JSON Stringify Formatting

One liner to easy format JSON

Thu, 06 Oct 2022

Rather than look at the console all the time I find it to be nice to display an objects properties right in the UI where the component rests. This snippet will display the object in a clean format in the UI

<pre><code>{JSON.stringify(DATA, null, 2)}</code></pre>
Buy Me A CoffeeDigitalOcean Referral Badge
Loading...
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge