2

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...

1
  • 1
    Yes you can do it. You can use Bootstrap for static modals and then have your custom components for rest of site. But if you wish to share data between react and bootstrap element, its better to create your own Modal component. Going outside a frameworks' scope will make your code fragile. Commented Nov 8, 2016 at 13:57

1 Answer 1

5

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/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.