File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
packages/react-query-devtools/src Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 getResizeHandleStyle ,
2323 getSidedProp ,
2424 defaultPanelSize ,
25+ displayValue ,
2526} from './utils'
2627import type { Corner , Side } from './utils'
2728import {
@@ -846,7 +847,7 @@ const ActiveQuery = ({
846847 overflow : 'auto' ,
847848 } }
848849 >
849- { JSON . stringify ( activeQuery . queryKey , null , 2 ) }
850+ { displayValue ( activeQuery . queryKey , true ) }
850851 </ pre >
851852 </ Code >
852853 < span
Original file line number Diff line number Diff line change @@ -117,11 +117,12 @@ export function useIsMounted() {
117117/**
118118 * Displays a string regardless the type of the data
119119 * @param {unknown } value Value to be stringified
120+ * @param {boolean } beautify Formats json to multiline
120121 */
121- export const displayValue = ( value : unknown ) => {
122+ export const displayValue = ( value : unknown , beautify : boolean = false ) => {
122123 const { json } = SuperJSON . serialize ( value )
123124
124- return JSON . stringify ( json )
125+ return JSON . stringify ( json , null , beautify ? 2 : undefined )
125126}
126127
127128// Sorting functions
You can’t perform that action at this time.
0 commit comments