juan garcia juan garcia - 29 days ago 26
HTML Question

Is it correct to use react js with pure bootstrap?

I am working on some migrations, some of the legacy code works with bootstrap and bootstrap uses behind the scenes jquery as a dependency...

I was wondering if we can use pure bootstrap with react, does bootstrap interfere with the nature of react virtual DOM?
is it possible to use it without running into further problems in the future?

Modals, Popovers could be sensible to mixing this two techs?

Changing to react-bootstrap / material ui, means further changes for me...

Answer

It might be less of a pain to just use react-bootstrap than jQuery bootstrap plugins. React overwrites the DOM on updates, so if bootstrap adds something to the DOM like jQuery usually does (for example a modal), if the parent node is updated then your shiny modal might just disappear into oblivion. To prevent that, you should make sure you re-init every plugin on componentDidUpdate.

More info about this here: http://tech.oyster.com/using-react-and-jquery-together/