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

228
Vistas
Conditionally render a component React

In my application, I want to conditionally render 2 different Tooltip from recharts library depending if level.value != "A"

As seen below, I try to achieve this by using a ternary operator, as modeled in this article https://flexiple.com/react/conditional-rendering-in-react/. However, now no Tooltip shows up if the level is A or not. Also when I console.log(level.value != "A") it is evaluating correctly.

return(
    <>
//other code
        <div>
           {(level.value != "A") ? (
             <Tooltip labelStyle={{ color: "black" }} />
           ) : (
            <Tooltip content = {<CustomTooltip/> } labelStyle={{ color: "black" }} />
           ) }            
        </div>   
    </>
);

Update: Needed !== instead of !=

about 4 years ago · Juan Pablo Isaza
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