question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get the name of component?

See original GitHub issue

Hi, I have a custom component:

class BaseComponent extends Component { xxxxxx }

And now i use this.constructor.name return the right name: BaseComponent in dev environment, but it return value: t in release environment.

I want to get the right name of component, what should i do?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Haiwen01commented, Oct 26, 2016

Ok, I got it!

0reactions
projectzerorncommented, Apr 12, 2017

@Haiwen01 how to resolve this problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get component name in React - Stack Overflow
Class Components. You can use this.constructor.name to obtain the name of your component. (Using React 16.x as of this writing).
Read more >
React get components name | Sololearn: Learn to code for ...
Hello everyone! given a react component, is it possible to get the name of the class that component is instance of? something like...
Read more >
How to get the class (component's) name in angular. - Medium
Recently i've encountered a problem where i wanted to have a list of different reusable “dynamic” components nested in a wrapper component in ......
Read more >
How to get component name? - Vue Forum
Hi there! and take a peak inside. In this case, your “name” property is found under the $options property.
Read more >
Solved: Component name as text - Power Platform Community
I have a component called "Q" with a label object called "QText". I want "QText.Text" property to have the valve of Q component...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found