8000 How to use this module with TypeScript · Issue #7 · procoders/ra-input-json · GitHub
[go: up one dir, main page]

Skip to content

How to use this module with TypeScript #7

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

Open
orionla2 opened this issue Aug 18, 2020 · 0 comments
Open

How to use this module with TypeScript #7

orionla2 opened this issue Aug 18, 2020 · 0 comments

Comments

@orionla2
Copy link

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.

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

No branches or pull requests

1 participant
0