react-json-editor-ajrm icon indicating copy to clipboard operation
react-json-editor-ajrm copied to clipboard

Installation instructions are incomplete

Open samtipton opened this issue 2 years ago • 1 comments

  1. What version of RJEA are you using (react-json-editor-ajrm version)? *REQUIRED 2.5.13
  2. What operating system and processor architecture are you using? *REQUIRED 2019 Intel Mac Monterey
  3. What did you do? *REQUIRED followed instructions to npm i --save react-json-editor-ajrm and
        import JSONInput from 'react-json-editor-ajrm';
        import locale    from 'react-json-editor-ajrm/locale/en';
    
  4. What did you expect to see? *REQUIRED Could not resolve the library, had to run npm i @types/react-json-editor-ajrm then error appeared on

line

import locale from react-json-editor-ajrm/locale/end

"TS7016: Could not find a declaration file for module 'react-json-editor-ajrm/locale/en'. <absolute_path> implicitly has an 'any' type.   If the 'react-json-editor-ajrm' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-json-editor-ajrm'

  1. What did you see instead? *REQUIRED

Working setup instructions getting example file to working order

samtipton avatar Jun 13 '22 14:06 samtipton

It is in working order. Your issue is that you are using typescript but this project doesn't provide types. You need to tell your project a global type for it. Add a global.d.ts file with the following

declare module "react-json-editor-ajrm/locale/en";

Then it will import as any

raymondKelly avatar Jul 11 '22 21:07 raymondKelly