MDB React TypeScript Support


Topic: MDB React TypeScript Support

Seth Zollinger asked 2 years ago

I was interested in MDB for React (v 4.8.2) and on the npm package page (https://www.npmjs.com/package/mdbreact) i read "TypeScript Modules". The base Package does not seem to contain a typescript definition file and when building I get the error message:
Could not find a declaration file for module 'mdbreact'
Am I missing something? I was not able to find a @types/mdbreact package. Or is TypeScript only supported in the pro version? Thanks

Anna Morawska staff answered 2 years ago

Hi Seth, Thank you for pointing it out - no, TypeScript is not supported yet in our project, it's just a typo which we didn't notice.  We will correct this during the next release. Best, Ania

Seth Zollinger commented 2 years ago

Thank you, is TypeScript support planned or when will it be added?


Jakub Mandra staff premium commented 2 years ago

It is not planned as a priority, we can't define the time we will add it.


muturgan commented 2 years ago

Just feedback.
Typescript support is very necessary!


Mark Gregory pro answered 2 years ago

For the time being you could use

 

const {MDBContainer, MDBRow, MDBCol} = require('mdbreact')

if that helps 

 


Anna Morawska staff commented 2 years ago

Thank you for sharing!


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: React
  • MDB Version: 4.7.1
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: Yes
  • Provided link: Yes