Navbar

paige asked 7 years ago

I'm sure you guys are working really hard over there, and my team I appreciate your work, but there are definitely some issues with your product that need attention. We want to use the Navbar but we can't get past this error. Uncaught Error: Element ref was specified as a string (navbar) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner). We've tried all the suggested fixes(uninstalling mdbreact and adding package manually to our package.json with the links provided. I've actually tried two of them, one ending in .git, and another ending in "update". Neither of these "fixes" have worked for us. Please help us out here. We really can't waste much more time with this. Some good docs or help with these common and widespread issues would really be appreciated!

Jakub Strebeyko staff answered 7 years ago

Hi there paige,

Thanks for reaching out! First, please make sure you have followed the installation guide completely. The message not unequivocal, pointing at two possible trouble sources.

First, it may have to do with (well, obviously) navbar ref being a string, as this practice is being depreciated in newer versions of React. This case scenario issue is being taken care of as we speak, and to fix it locally, please visit the MDB React node module (node_modules/mdbreact/src/components/Navbar.js) and make sure there is no string ref (i.e. ref='navbar' or ref=this.state.navbar, whereas in state you would have something like navbar: 'navbar'). Deleting these (or replacing them with a ref function, if you must) should solve the issue.

The other case scenario is more complex, as it involves having conflicting React versions installed simultaneously. It would be helpful to know what version of React you are using in your project - for that you can simply compare package.json files of the project and of 'mdbreact'. If they differ, it might require manual update of either of packages.

Hope it helps!

With Best Regards,
Kuba


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