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

263
Vistas
Why isn't there a "class" prop for React?

In React.DOM.Props from purescript-react, DOM node attributes are nearly exhaustively listed there, except for a class attribute (I'd suspect it to be named _class, similar to _type for Purescript's syntax issue). I tried to make my own with

_class :: String -> Props
_class = unsafeMkProps "class"

And attempted to use it, but after inspecting the HTML, React didn't include the attribute! Why is this? Why can't I use a class attribute in my DOM nodes?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You probably want to use className here and not class. This is done to prevent confusion between a JavaScript class and the DOM attribute class.

Here's what the official documentation says:

To specify a CSS class, use the className attribute. This applies to all regular DOM and SVG elements like <div>, <a>, and others.

It is actually even listed in the page you're linking to, here

className :: String -> Props
over 4 years ago · Santiago Trujillo 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