Skip to main content

Hi

I am using React 18 (TSX) for my UI application. I want to integrate Box Content Explorer into my application.

Hi

I am using React 18 (TSX) for my UI application. I want to integrate Box Content Explorer into my application.

Receiving below error while importing “box-ui-elements/dist/content-explorer”. Also tried to import from “box-ui-elements/es/elements/content-explorer”

Could not find a declaration file for module 'box-ui-elements/dist/preview'. 'c:/Brown_Adv/Touchpoint_2.0/touchpoint-2-0-frontend/node_modules/box-ui-elements/dist/preview.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/box-ui-elements` if it exists or add a new declaration (.d.ts) file containing `declare module 'box-ui-elements/dist/preview';`

 


Also tried declaring ContentExplorer.d.ts with below code still facing some issue:

import { ComponentType } from 'react';

declare module 'box-ui-elements/dist/preview' {
const Preview: ComponentType<any>;
export default Preview;
}

Also tried // @ts-ignore above the import statement.


Reply