Skip to content

Export Component type on top level #88

@freedom0116

Description

@freedom0116

In the our code, we check render the css by checking attr data-copied. To make typescript working correctly, we import SectionElement from file @uiw/react-json-view/cjs/store/Section. However, typescript doesn't allow deep module import for the moduleResolution: builder. is it possible to expose the CopiedSectionElementandSectionElement` to the top level so import is viable in more modern typescript setup.

const Copied = ReactJsonView.Copied

export const JsonView = ({
  ...
}: JsonViewerProps) => {
  return (
    <ReactJsonView
      ...
    >
      <Copied
          render={({ style, onClick, ...props }: SectionElement<"svg">) => {
          const copied = props["data-copied"];
          ...
      }/>
    </ReactJsonView>
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions