4 ms·
Using them on separate pages is fine, but using React and jQuery on the same page is usually not a good idea since React needs to “own” its slice of the DOM and
by dceddia 7y ago
Using them on separate pages is fine, but using React and jQuery on the same page is usually not a good idea since React needs to “own” its slice of the DOM and changing things in there with jQuery could cause weird bugs.
But anyway, it’s impossible to tell from just the package.json file whether React and jQuery are being used on the same page, or just both used in different parts of the app.
- KajMagnus 7y agoNow jQuery is gone (see my other reply just nearby, in this same comments tree). Actually, when I was starting with React, then for a while Talkyard did use both jQuery and React on the same pages (not a good idea, I agree). I was careful to avoid the bugs you have in mind from happening, so that wasn't a problem, however, loading & using both libs wasn't good for performance — just parsing and executing the 30 kb min.js.gz jQuery bundle took maybe half a second? a second? on mobile phones, back at the time (2.5 years ago).
- alharith 7y agoI was a very early adopter of React at my company (fall 2013) and IIRC, using jQuery with React was still in the docs. edit: and it still is today, just a tad updated: https://reactjs.org/docs/integrating-with-other-libraries.html https://reactjs.org/docs/integrating-with-other-libraries.ht...
- KajMagnus 7y agoSame here :- ) Just a bit later, fall / winter 2014. Thanks for the link. I think I saw that page, or sth similar, back then. ... Now I found an old question I posted at StackOverflow about jQuery + React: https://stackoverflow.com/questions/27646347/is-it-okay-to-do-all-these-jquery-things-to-a-react-js-dom-tree https://stackoverflow.com/questions/27646347/is-it-okay-to-d...