'How can normal bootstap classes be used in React App?

function App() {
  return (
   <Navigation className="d-flex justify-content-end" />
  );
}

Should I Add cdn of bootstap files in the html file in the Public directory or import the bootstap package installed through npm in the component file or index.js file ?



Solution 1:[1]

You can either link to the CDN url or install it via npm/yarn/etc. Both versions work: https://getbootstrap.com/docs/5.1/getting-started/introduction/

I would recommend to put something like bootstrap in the bundle for several reasons, above all due to tree shaking possibility: Should JS dependencies be packed in the bundle, or loaded via CDN?

If you plan to work with react-bootstrap directly, you usually don't have to install bootstrap, unless you want to customize the SASS files: https://react-bootstrap.netlify.app/getting-started/introduction/#installation

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1