react-json-view
react-json-view copied to clipboard
Is there a way to not showindexes of arrays?
I'd ideally like to be able to just select text to copy/paste (versus relying on the inline-copy button), and showing the indexes makes it not possible.
You can use something like this
<JsonView >
<JsonView.Colon render={() => <span />}/>
<JsonView.KeyName
render={({ ...props }, { type, value, keyName }) => {
if (!isNaN(parseFloat(keyName))) {
return <span />
}
return <span {...props}>{keyName}:</span>
}}
/>
</JsonView>
If there are numeric keys out of array, then it will not work
+1 to this, the proposed workaround doesn't really work that well
@globetro @antipopp @morgothko Upgrade v2.0.0-alpha.28
https://github.com/uiwjs/react-json-view/blob/18a9334a17fb2f23c9d30b7c1c9e0cdabd7eb965/core/README.md?plain=1#L687-L710
A simple boolean parameter would be excellent, something like displayArrayIndexes.
Also, that workaround does not pass VS Code linting, complains about the type: