Last active
May 9, 2023 21:24
-
-
Save yano3nora/c9c9f5cb132875fef85bda8fa84e5a4a to your computer and use it in GitHub Desktop.
JSON.stringify Prettify. #js
This file contains 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' | |
import { Code } from '@chakra-ui/react' | |
<Code | |
as={'pre'} | |
display={'block'} | |
padding={1} | |
overflowX={'scroll'} | |
> | |
{JSON.stringify( | |
{ | |
hello: 'world', | |
}, | |
null, // replacer を null に | |
' ', // spacer で \t (タブ) や space を指定 | |
)} | |
</Code> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment