Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

94
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda