user1272965 user1272965 - 1 month ago 8
React JSX Question

How to replace container class in react-bootstrap

I've installed react-bootstrap, and have proven I can use the grid components which is my primary need. But why is "Container" not found, and how should I wrap my outermost content so that my page has margins and whatever else is normally set by bootstrap?

I understand that I can use regular CSS, but (a) wouldn't a Container be cleaner to match the bootstrap within, and (b) what else should be there, beside margins, to wrap all the inner stuff and still have it work well?

Answer Source

You can :

  • Use the reactstrap lib that contains this Container comp you are looking for
  • Use the bootstrap container CSS class :

<div className="container"> ... </div>

In both case, a <link rel="stylesheet" href="path/to/bootstrap/css/lib"> will be required to get this working.