Skip to content

Instantly share code, notes, and snippets.

@l3aconator
Created November 29, 2018 00:21
Show Gist options
  • Save l3aconator/6a953a873e0c59a351e74684b278fba9 to your computer and use it in GitHub Desktop.
Save l3aconator/6a953a873e0c59a351e74684b278fba9 to your computer and use it in GitHub Desktop.
Utility function for dumping json onto page when using react
import React from 'react';
export const dump = data => {
return (
<pre
style={{
width: '100%',
wordWrap: 'break-word',
whiteSpace: 'pre-wrap',
padding: 20,
margin: '20px 0',
backgroundColor: '#f2f2f2'
}}
>
Data 💩 <br />
{JSON.stringify(data)}
</pre>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment