AndrewRedican / react-json-editor-ajrm

A modular, easy to use, react component, to view, edit, and debug javascript objects.
MIT License
355 stars 124 forks source link

Installation instructions are incomplete #214

Closed samtipton closed 1 year ago

samtipton commented 2 years ago
  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

raymondKelly commented 2 years ago

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