Skip to main content

Issue with using content explorer with React Typescript

  • August 24, 2023
  • 1 reply
  • 221 views

Good afternoon, there is a project for react typescript. All the integration has already been fully done, but we got a problem with the display of UI Elements.

When importing a component, I got the error Could not find a declaration file for module ‘box-ui-elements/es/elements/content-explorer’. ‘***/node_modules/box-ui-elements/es/elements/content-explorer/index.js’ implicitly has an ‘any’ type. (any component, this one as an example).

How can I import and make it work instead of with a typescript?

1 reply

  • Participating Frequently
  • 6 replies
  • August 24, 2023

Hello!


The elements have not been migrated to TypeScript yet but you can create a ContentExplorer.d.ts file in your project and copy the props from the source: https://github.com/box/box-ui-elements/blob/master/src/elements/content-explorer/ContentExplorer.js#L93-L144


or you can add // @ts-ignore above the import that’s causing the error


Thanks!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings