SelectOption: Cannot read property 'parentNode' o


Topic: SelectOption: Cannot read property 'parentNode' of null

pidupuis pro asked 6 years ago

Hi, Using MDB React 4.6.1 and React 16.4.1, I've tried this code:
<Row>
  <Col xs="12">
    <Select getValue={this.getSelectManagers} multiple>
      <SelectInput selected="Choose your option" />
      <SelectOptions>
        <SelectOption>Option nr 1</SelectOption>
        <SelectOption>Option nr 2</SelectOption>
        <SelectOption>Option nr 3</SelectOption>
      </SelectOptions>
    </Select>
    <label>Example label</label>
  </Col>
</Row>
And I've got the following error:
Uncaught TypeError: Cannot read property 'parentNode' of null
This is triggered at line 25 of src/components/pro/SelectOption.js file. Any idea ?

Jakub Mandra staff premium answered 6 years ago

Hello, I've tried your code and its working fine for me. I suggest you to reinstall mdb dependencies: 1. Remove "mdbreact" from package.json 2. Run npm install or yarn 3. Bring back the "mdbreact" link to dependencies 4. Run again npm install or yarn Of course, you should use MDB React withing create-react-app environment. If this won't work, please contact us further. Best regards, Jakub from MDB

pidupuis pro commented 6 years ago

Wow, it works... That's the new "turn it on and off again" Thanks a lot!

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: No
  • Technology: MDB React
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No