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

193
Vistas
How to find the name of a variable calling a function?
const Button = myFunc();

Now from inside myFunc, I want to get the string "Button" (even before it is assigned to it). Is that possible?

Edit:

I see a lot of comments asking why this is even needed. I'm creating a React component by extending an existing component and adding styles to it (via a new style element at the document head). I want the new class to be called by ".RedButton", for example:

const RedButton = extend(Button)`
  color: red;
`;

...

const extend = OriginalComponent => {
  
  const newComponentName = ... // Here I need the use of "RedButton"
  ...
};
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