Skip to main content
Question

React 18 Box UI elements integration (TSX)

  • May 5, 2025
  • 2 replies
  • 79 views

Hi

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

2 replies

  • Author
  • Participating Frequently
  • May 5, 2025

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';`

 


  • Author
  • Participating Frequently
  • May 5, 2025

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.