Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


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

bioaster 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 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

bioaster 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

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB React
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No
Tags