Created
February 13, 2020 15:13
-
-
Save asm-jaime/221cc25b4db52c965291499f4b682530 to your computer and use it in GitHub Desktop.
button, open json data in new tab
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
<button onClick={() => { | |
const jsonData = JSON.stringify(state, null, 2); | |
const w = window.open(); | |
w.document.open(); | |
w.document.write('<html><body><pre>' + jsonData + '</pre></body></html>'); | |
w.document.close(); | |
}}>open</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment