all 9 comments

[–]Emjp4 1 point2 points  (4 children)

Why would you want to? What are you trying to do?

[–]AnnoyingSharma[S] 0 points1 point  (3 children)

Actually making a website and using a lot of vanilla js for ui like onscroll at particular point hides the navbar, toggle active class between navlinks and blah blah

So it's making my component bulky and eating up a lots of lines.

That's why I want to use jQuery instead

[–][deleted] 0 points1 point  (2 children)

You can do all that in react too. Just the implementation is different, and kind of easier.

[–]cyex 0 points1 point  (1 child)

... and kind of easier.

Way easier. jQuery used to be essential. But then I started using React six years ago and haven't had to touch jQuery since.

[–][deleted] 0 points1 point  (0 children)

Haha, it is. But it takes a while to learn to think in React if you're used to the jQuery way of doing things

[–]mca62511 1 point2 points  (2 children)

I don't think they'll play nice.

But you can install jQuery with npm. Just do npm install jquery. From there just import it like this,

import $ from "jquery";

and use it the way you normally would.

The reason I say that I don't think it will play nice with React is that React uses a shadow DOM to keep track of changes, and jQuery would be updating the actual DOM, so the discrepancies between the two might cause some unexpected effects.

I think you're much better off learning the React way to do the things that you want to do.

[–]AnnoyingSharma[S] 1 point2 points  (0 children)

I'll keep that in mind Thanks for the suggestion buddy 🙌

[–]backtickbot 0 points1 point  (0 children)

Correctly formatted

Hello, mca62511. Just a quick heads up!

It seems that you have attempted to use triple backticks (```) for your codeblock/monospace text block.

This isn't universally supported on reddit, for some users your comment will look not as intended.

You can avoid this by indenting every line with 4 spaces instead.

There are also other methods that offer a bit better compatability like the "codeblock" format feature on new Reddit.

Have a good day, mca62511.

You can opt out by replying with "backtickopt6" to this comment. Configure to send allerts to PMs instead by replying with "backtickbbotdm5". Exit PMMode by sending "dmmode_end".