Skip to content

How to use this module with TypeScript #7

@orionla2

Description

@orionla2

I imported according to example
import { JSONEditor, JSONEView } from 'ra-input-json';
Types script throw error that there is no types and suggest to install via
npm install @types/ra-input-json but there was no types.
So I tried to create my own:

declare module "ra-input-json" {
  import { JSONEditor, JSONEView } from 'ra-input-json';
  export default () => {
    return {
      JSONEditor,
      JSONEView,
    }
  }
}

TS stop showing errors but on start of app it throw error:Error: withRef is removed. To access the wrapped instance, use a ref on the connected component
If I remove my declaration app compile and work. Please advise how can I use your module with TS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions