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.

Element type comparing

See original GitHub issue

It seems like with react-hot-loader@3 it’s not possible to check element type for imported components:

const element = <ImportedComponent />
console.log(element.type === ImportedComponent)

Logs false for me. Is this a bug or something that should not be supported?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:34
  • Comments:76 (7 by maintainers)

github_iconTop GitHub Comments

10reactions
JorgenEvenscommented, Oct 22, 2017

I’m running into the same problem, this is how I am working around the issue:

const ImportedComponent = (props) => { ... }
const ImportedComponentType = (<ImportedComponent />).type;

const element = <ImportedComponent />
console.log(element.type === ImportedComponentType)
5reactions
w3appscommented, Jun 15, 2016

Is it possible to fix this thing or is it too big of a change?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Comparison of different element types - ResearchGate
Download scientific diagram | Comparison of different element types from publication: Failure of Flexible Adhesive Joints | Flexible adhesives, ...
Read more >
How to compare specified type element of the array?
I can just get the type of element via typeof(T).GetElementType(), but it seems no use to compare the two element.
Read more >
Element Type Comparison - FEA-Solutions (UK) Ltd
29 Jun Element Type Comparison​​ When building a mesh for FEA, there are different types of elements that can be used: – Line...
Read more >
Compound vs Element - Difference and Comparison - Diffen
Comparison chart​​ A compound contains atoms of different elements chemically combined together in a fixed ratio. An element is a pure chemical substance...
Read more >
Different Types of FEA Elements / How to Decide the Element ...
As we discussed the major element types are 1D, 2D and 3D and all these elements are further segregated based on mid-side nodes...
Read more >

github_iconTop Related Medium Post

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