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

bioaster pro asked 4 years ago

Hi, Using MDB React 4.6.1 and React 16.4.1, I've tried this code:
  <Col xs="12">
    <Select getValue={this.getSelectManagers} multiple>
      <SelectInput selected="Choose your option" />
        <SelectOption>Option nr 1</SelectOption>
        <SelectOption>Option nr 2</SelectOption>
        <SelectOption>Option nr 3</SelectOption>
    <label>Example label</label>
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 4 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 4 years ago

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

Please insert min. 20 characters.


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



Specification of the issue

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