Topic: Can't get the SideNav component to work

robnewton pro asked 4 years ago

I am trying to use the SideNav component, but every time I try use it I get this error:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `SideNavPage`.
I am using the link for the pro version from the gitlab in my package.json with my access token. I just copied and pasted the page from the documentation, so I haven't added my own information yet. I also just set up the pro version today, so I should be on the latest version. What is going wrong with it?

Jakub Mandra staff answered 4 years ago

The docs you have used should be up to date and work fine.

But you said that, you have been sure that you have installed PRO, because Gradeint Buttons have been working.

Well, thanks to that I found that there is mistake in documentation. Gradient Buttons is a free component.

I assume, that you started with mdbreact free, that is why SideNav didn't work.

Jakub Mandra staff commented 4 years ago

Also, I want to remind you, that we are currently working on completely new standard of documentation

Jakub Mandra staff answered 4 years ago


What is the stack of your project?

Do you use create-react-app application, or some custom boilerplate?

Have you imported `SideNavPage` to your index.js file?

I just had tested this snippet in fresh c-r-a and everything's ok.


Waiting for hearing from you


robnewton pro commented 4 years ago

I started with create-react-app then put files from a custom template into the directory. I do have the SideNavPage imported from the index.js file. I also know for a fact that pro is working for me because when I updated to it, I tested pro with the gradient buttons. The gradient buttons worked, but the SideNavPage doesn't.

robnewton pro commented 4 years ago

Never mind. I got it working. For some reason the code in the documentation didn't work for me, but copying the file from the example app worked.

Jakub Mandra staff commented 4 years ago

Did you use this one

We are currently working on new documentation, hope this would not happen again...

Thanks for pointing out.

robnewton pro commented 4 years ago

Yes, I used that one. 

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: 4.7.1
  • Device: MacBook Pro
  • Browser: Google Chrome
  • OS: macOS Mojave v10.14
  • Provided sample code: Yes
  • Provided link: No