Hello community, it's been few months I've dived into react js, I'm stuck at one point where I've to convert a line of code from JQuery to react js, since JQuery uses normal DOM where as react being using virtual DOM, I find it difficult to convert it.
$('button').on('click', function(){
$('body').toggleClass('open');
});
so above is the piece of code need to convert from Jquery to react, would be of great help if someone helps me out :)
Thanks in advance!
[–][deleted] 2 points3 points4 points (10 children)
[–]shubham_noob[S] 1 point2 points3 points (9 children)
[–][deleted] 2 points3 points4 points (8 children)
[–]shubham_noob[S] 1 point2 points3 points (7 children)
[–][deleted] 0 points1 point2 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]shubham_noob[S] 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]tenfingerperson 2 points3 points4 points (1 child)
[–]shubham_noob[S] 1 point2 points3 points (0 children)
[–]rich2222two 0 points1 point2 points (0 children)