Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

91
Vistas
Multiple Bootstrap React components in one Bootstrap Row

I'm trying to create a "main Bootstrap row" that can house different React components in separate columns within that row, but since they are completely different React components, they want to render underneath each other. Im not sure if its a CSS, Bootstrap or React mistake I'm making.

Right now, I just need to render one component of col-1 and a different component of col-11 on the same Row, a simplified version of my code is as follows:

ReactApp.js:

Import React from "react";
Import {Container, Col, Row} from "react-bootstrap";
Import Comp1 from "./components/Comp1";
Import Comp2 from "./components/Comp2";

function App() {
 return (
  <Row>
   <Comp1 />
   <Comp2 />
  </Row>
 );
}
export default App;

Componenet1.js:

Import React from "react";
Import {Container, Col, Row} from "react-bootstrap";

const Comp1 = () => {
 return (
  <Col md={1}>
   <content>
  </Col>
 );
}
export default Comp1;

Componenet2.js:

Import React from "react";
Import {Container, Col, Row} from "react-bootstrap";

const Comp2 = () => {
 return (
  <Col md={11}>
   <content>
  </Col>
 );
}
export default Comp2;

Thanks in advance for any help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

2 things:

  1. Make sure you have installed both bootstrap and react-bootstrap using NPM: npm install bootstrap react-bootstrap

  2. Make sure you import the main css file from bootstrap, so that it can apply the grid styles import 'bootstrap/dist/css/bootstrap.min.css';

import "./styles.css";
import { Col, Container, Row } from "react-bootstrap";
import 'bootstrap/dist/css/bootstrap.min.css';

export default function App() {
  return (
    <Container>
      <Row>
        <Comp1 />
        <Comp2 />
      </Row>
    </Container>
  );
}

const Comp1 = () => {
  return <Col md={1}>Hello world</Col>;
};

const Comp2 = () => {
  return <Col md={11}>Foobar</Col>;
};

Codesandox

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda