Click here to Skip to main content
15,867,957 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to transform the below jquery code to react js code.

$("#leftside-navigation .sub-menu > a").click(function(e) {<br />
  $("#leftside-navigation ul ul").slideUp(), $(this).next().is(":visible") || $(this).next().slideDown(),<br />
  e.stopPropagation()<br />
})


please help me with this issue.

What I have tried:

I am a beginner in ReactJs, I don't know how to convert jquery code to react js code.
Posted
Updated 29-Apr-23 1:32am

1 solution

// sidebar menu active
// $("#sidebar li").on("click", function () {
// $(this).addClass("active").siblings().removeClass("active");
// });

// sidebar submenu hide/show
// $("#sidebar .sub_menu").on("click", function () {
// alert("Hello");
// $(this).children("ul").slideToggle("1000");
// $(this).find(".right_angle").toggleClass("fa-angle-down fa-chevron-right");
// });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900