3 ms·
There isn't a built-in way to detect type of component. It would be useful when you want a parent component to encapsulate certain logic/behavior but not hard-c
by dsego 8y ago
There isn't a built-in way to detect type of component. It would be useful when you want a parent component to encapsulate certain logic/behavior but not hard-code the presentation. I know there's name() but it only works if my component is a function. Otherwise I think I need to assign some special identifier, which sucks.
You can see a great presentation of the technique in this video:
https://youtu.be/hEGg-3pIHlE https://youtu.be/hEGg-3pIHlE