Skip to content

Conversation

@imdanielsp
Copy link
Collaborator

Change: Closes #180

This change introduces the displayArrayKey property to the
ReactJsonView component defaulting to true. This property will allow
users to hide the array-key in the component output.

Verification:

  • Run unit test
  • Added unit test
  • Toggle the displayArrayKey and visually verified the key is not
    displayed when expected

Change: Closes mac-s-g#180

This change introduces the `displayArrayKey` property to the
`ReactJsonView` component defaulting to `true`. This property will allow
users to hide the `array-key` in the component output.

Verification:

- Run unit test
- Added unit test
- Toggle the `displayArrayKey` and visually verified the key is not
displayed when expected
@erunion
Copy link

erunion commented Jun 12, 2020

@mac-s-g Any chance we can get this in?

@mac-s-g mac-s-g merged commit 1487e87 into mac-s-g:master Feb 5, 2021
@mac-s-g
Copy link
Owner

mac-s-g commented Feb 5, 2021

this is technically a new feature, so i'll bump the minor patch to 1.21.0, and release to npm.

@nedkelly
Copy link

Was this released? I'm using 1.21.1 but I get this type error:

Type '{ src: any; theme: "ashes" | "rjv-default"; indentWidth: number; collapsed: number; collapseStringsAfterLength: number; displayDataTypes: boolean; displayArrayKey: true; style: { fontSize: ReactText; backgroundColor: string; }; }' is not assignable to type 'IntrinsicAttributes & ReactJsonViewProps & { children?: ReactNode; }'.
  Property 'displayArrayKey' does not exist on type 'IntrinsicAttributes & ReactJsonViewProps & { children?: ReactNode; }'.ts(2322)

And displayArrayKey doesn't exist in node_modules/react-json-view/index.d.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make array-key values toggleable

4 participants