Created
November 29, 2018 00:21
-
-
Save l3aconator/6a953a873e0c59a351e74684b278fba9 to your computer and use it in GitHub Desktop.
Utility function for dumping json onto page when using react
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
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