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

313
Vistas
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 Respuestas
Responde la pregunta

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 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