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

159
Vistas
DisplayName of export function in React

I read React docs where it was told that by default ReactClass.displayName is defined and = name of class (function). I have two components. Component A and B and export my named functional component B into another place:

import React, { Suspense } from 'react';
import someImportedclassComponentA from 'otherFile.jsx'

export function B(props) {
      const A = someImportedclassComponentA;
      return (
        <Suspense>
          <A {...props} />
        </Suspense>
      );
    }

In the other file (after import B) i want to get displayName of B ("B" expected):

let name = B.displayName;

I get undefined but when i do:

let name = B.name;

It works and returns "B". It is mean that function B is recognized as simple function, not React functional component with displayName. How it is possible ? Why it is not react functional component as i expected?

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