react-json-tree

  • Version 0.18.0
  • Published
  • 305 kB
  • 3 dependencies
  • MIT license

Install

npm i react-json-tree
yarn add react-json-tree
pnpm add react-json-tree

Overview

React JSON Viewer Component, Extracted from redux-devtools

Index

Functions

function JSONTree

JSONTree: ({
data: value,
theme,
invertTheme: shouldInvertTheme,
keyPath,
labelRenderer,
valueRenderer,
shouldExpandNodeInitially,
hideRoot,
getItemString,
postprocessValue,
isCustomNode,
collectionLimit,
sortObjectKeys,
}: Props) => JSX.Element;

    Interfaces

    interface CommonExternalProps

    interface CommonExternalProps {}

      property collectionLimit

      collectionLimit: number;

        property getItemString

        getItemString: GetItemString;

          property hideRoot

          hideRoot: boolean;

            property isCustomNode

            isCustomNode: IsCustomNode;

              property keyPath

              keyPath: KeyPath;

                property labelRenderer

                labelRenderer: LabelRenderer;

                  property postprocessValue

                  postprocessValue: PostprocessValue;

                    property shouldExpandNodeInitially

                    shouldExpandNodeInitially: ShouldExpandNodeInitially;

                      property sortObjectKeys

                      sortObjectKeys: SortObjectKeys;

                        property valueRenderer

                        valueRenderer: ValueRenderer;

                          Type Aliases

                          type GetItemString

                          type GetItemString = (
                          nodeType: string,
                          data: unknown,
                          itemType: React.ReactNode,
                          itemString: string,
                          keyPath: KeyPath
                          ) => React.ReactNode;

                            type IsCustomNode

                            type IsCustomNode = (value: unknown) => boolean;

                              type Key

                              type Key = string | number;

                                type KeyPath

                                type KeyPath = readonly (string | number)[];

                                  type LabelRenderer

                                  type LabelRenderer = (
                                  keyPath: KeyPath,
                                  nodeType: string,
                                  expanded: boolean,
                                  expandable: boolean
                                  ) => React.ReactNode;

                                    type PostprocessValue

                                    type PostprocessValue = (value: unknown) => unknown;

                                      type ShouldExpandNodeInitially

                                      type ShouldExpandNodeInitially = (
                                      keyPath: KeyPath,
                                      data: unknown,
                                      level: number
                                      ) => boolean;

                                        type SortObjectKeys

                                        type SortObjectKeys = ((a: unknown, b: unknown) => number) | boolean;

                                          type Styling

                                          type Styling = StylingFunction;

                                            type ValueRenderer

                                            type ValueRenderer = (
                                            valueAsString: unknown,
                                            value: unknown,
                                            ...keyPath: KeyPath
                                            ) => React.ReactNode;

                                              Package Files (2)

                                              Dependencies (3)

                                              Dev Dependencies (31)

                                              Peer Dependencies (2)

                                              Badge

                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/react-json-tree.

                                              • Markdown
                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/react-json-tree)
                                              • HTML
                                                <a href="https://www.jsdocs.io/package/react-json-tree"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>