Error when adding MDBSelect into react project


Topic: Error when adding MDBSelect into react project

Thomsen pro premium priority asked 4 years ago

Expected behavior MDBSelect should not throw below error for the options provided:

Actual behavior Adding MDBSelect to react project should not throw below error.

Error Description:** Uncaught TypeError: Cannot read property 'findIndex' of undefined at ot (mdb-react-ui-kit.esm.js:1) at renderWithHooks (react-dom.development.js:14803) at mountIndeterminateComponent (react-dom.development.js:17482) at beginWork (react-dom.development.js:18596) at HTMLUnknownElement.callCallback (react-dom.development.js:188) at Object.invokeGuardedCallbackDev (react-dom.development.js:237) at invokeGuardedCallback (react-dom.development.js:292) at beginWork$1 (react-dom.development.js:23203) at performUnitOfWork (react-dom.development.js:22157) at workLoopSync (react-dom.development.js:22130) Resources (screenshots, code snippets etc.) Code Details:

import { MDBSelect } from 'mdb-react-ui-kit';

<MDBSelect size="sm" options={this.state.divisions}
placeholder="Division"/>


I see you're using the MDB5 version where we provide the data by the property data. Your example should look this way:

<MDBSelect size="sm" data={this.state.divisions} placeholder="Division"/>


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 1.0.0-alpha4
  • Device: Laptop
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No