Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add displayArrayKey property that hides the array keys #284

Merged
merged 4 commits into from
Feb 5, 2021

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