react-json-view icon indicating copy to clipboard operation
react-json-view copied to clipboard

fix: missing displayArrayKey props in TS typings

Open filmstarr opened this issue 3 years ago • 5 comments

Small fix for missing displayArrayKey property in TypeScript typings, as specified in README.

filmstarr avatar Apr 15 '21 00:04 filmstarr

This fix isn't available in the latest package. When will it be available?

iamdushyant avatar Apr 28 '21 07:04 iamdushyant

Hello, running into this problem as well. Hope this can be merged soon! Thanks for the nice package btw 👏

industriousparadigm avatar May 28 '21 16:05 industriousparadigm

This PR still hasn't been merged

davidpett avatar Aug 12 '22 13:08 davidpett

Hello, any news on this ?

antoine-giret avatar Oct 04 '22 07:10 antoine-giret

I can help. I also had this problem. This is my decision:

import ReactJson from 'react-json-view'
import { FC } from 'react'

type TReactJsonContainer = {
  data: object
}
export const ReactJsonContainer: FC<TReactJsonContainer> = ({ data }) => {  
  const props = {
    displayArrayKey: false,
    displayDataTypes: false,
    displayObjectSize: false,
    indentWidth: 2,
    name: null,
    src: data,
  } as any

  return (    
    <ReactJson
      {...props}
    />
  )
}

Victor-Sinitca avatar Feb 28 '23 11:02 Victor-Sinitca