Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!