question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React + MetisMenu don't work together properly

See original GitHub issue

Hello, I’m using React and after React’s render, I apply MetisMenu. If React doesn’t render again to update DOM, there is no problem. However, if React renders document more than once, MetisMenu’s onClick references get broken so menu not working. But actual problem is that applying MetisMenu after every render does not solve the problem because after first applying MetisMenu, it doesn’t let second time. I notice that MetisMenu uses jQuery.data() and mm data field to keep plugin values. And to solve the problem, I used this;

$('#menu_container').data('mm',false).metisMenu();

I placed above code to execute after every render of React, and problem solved. But it’s not confortable that’s why I like to note that.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
alpertunacommented, Aug 21, 2016

@achapela I looked over my old project for you. I achieved this avoiding render again and for this, I prepared menu part as an external bundle library to make it work independently. However it is not a proper usage. For my new projects I created new menu library just for react recently, you may want to look over it alpertuna/react-metismenu

1reaction
onokumuscommented, Mar 16, 2016

@alpertuna Sorunu bir de türkçe olarak onokumus@gmail.com adresine yazar mısın?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React + MetisMenu don't work together properly #92 - GitHub
Hello, I'm using React and after React's render, I apply MetisMenu. If React doesn't render again to update DOM, there is no problem....
Read more >
Is there a problem in 'react-metismenu-router-link' with react16?
in the use of library 'react-metismenu' there is not problem and work correctly,but this use anchor for selecting item of menu. that is...
Read more >
Developers - React + MetisMenu don't work together properly -
React + MetisMenu don't work together properly.
Read more >
react-metismenu-router-link - npm
Router link extension for react-metismenu menu component to work with react-router. For full documantion please visit react-metismenu.
Read more >
Add active class to li onclick react - Caritas Castellaneta
Put together we have our completed Tab component:You can render a normal html with ... React events do not work exactly the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found