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

314
Visualizações
Issue with col tags in react. Error: col is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`

In process of learning React.js with this link at 35:50 min getting problem with col tags. No surprise its is working for youtuber.

import React from "react";
import millify from "millify";
import { Typography, Row, col, Statistic } from "antd";
import { Link } from "react-router-dom";
const { Title } = Typography;

const HomePage = () => {
  return (
    <>
      <Title level={2} className="heading">  Global Crypto Stats </Title>

      <Row>
        <col span={12}> <Statistic title="Total cryptocurrencies" value="5" /> </col>
        <col span={12}>  <Statistic title="Total Exchanges" value="5" /> </col>
        <col span={12}> <Statistic title="Total Market cap" value="5" /> </col>
        <col span={12}> <Statistic title="Total 24h volume" value="5" />  </col>
        <col span={12}>  <Statistic title="Total Markets" value="5" /> </col>
      </Row>
    </>
  );
};

export default HomePage;

Error in browser: enter image description here

No beginners luck sigh :(

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have the case of col wrong.

In lower case, col represents the HTML <col> element, which can only be an empty element. However, Col with an upper-case C appears to be a component from the antd library. See for example its use here. Also, if you pay close attention to the video, it indeed uses <Col ...> rather than <col ...>.

Change col to Col in your import statement and in the various <col ...> ... </col> lines.

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