react-json-view
react-json-view copied to clipboard
The data on the last face cannnot collapse in very large json objects
I have a very large json objects. The previous data (small index)can be collapsed,but the data that follows(big index) cannot be collapsed。
<ReactJSONView
displayDataTypes={false}
name={false}
src={testResult.testResult}
shouldCollapse={jsonShouldCollpase}
groupArraysAfterLength={5}
collapseStringsAfterLength={100}
/>
export const jsonShouldCollpase = (field: any) => {
if( field?.type ==='array' && field?.src?.length>=5 || field?.type === 'object' && Object.keys(field?.src)?.length >=5) {
return true;
}
return false
}

+1