Why do we need a bootstrap reaction if there is an easy way?

I am developing a web application using reaction or angular, but am confused why people will use a library like bootstrap reaction ( https://react-bootstrap.imtqy.com/introduction.html ) or Angular-bootstrap? Because when I create, I just need to load the css framework using the link tag with its corresponding js lib, and then in the mate I just need to put the classes needed for the component. Isn't it that simple?

Thanks,

+5
source share
2 answers

This is due to the Javascript part of Bootstrap. CSS will work fine with a link tag.

But React and Angular are Javascript libraries that have a lot under the hood to control the DOM. If you also use something like Bootstrap or jQuery to control the DOM, it probably won’t work well with React or Angular, as they try to do similar things differently, possibly at the same time. Therefore, the DOM-related Javascript libraries must be rewritten so that they play well with React / Angular.

From the bootstrap reaction docs:

we do not ship with css enabled

All they deal with is JS.

+2
source

When you decided to work with reactjs , you chose a library that updates your DOM in debugging and sophisticated form.
It has a virtual DOM and a bunch of algorithms (like the Diffing algorithm ) to determine when and how to update the DOM in the fastest and most efficient and performing way.

When you combine this with another library that updates the DOM, you basically interrupt these algorithms to get your work done.
In addition to performance aspects, you are working against a reaction pattern, you are violating the “component pattern”.
React-Bootstrap here to help you save a component template with their components. you just need to include css and other resource files.
Their components do nothing but render HTML with the appropriate class names that correspond to the classes that are in the bootstrap css files.
They do this just like all your other components, through props .
Thus, you can have bootstrap components that play well with your other components without breaking the pattern.

Yes, it’s easier to dump css and js files, and everything just works, but it’s harder to maintain, debug, and scale.

+1
source

Source: https://habr.com/ru/post/1271863/


All Articles