You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can let u passing other component as the root element like Comp<Comp1>.
But u can not use basic HTML elements like this Comp<div> since div is not a component.
But with a dirty fix:
structDiv;implComponentforDiv{ ... }
Now u can pass it like Comp<Div>.
That's too dirty and there maybe better solution for this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Imagine that you are from React.js and trying to make a component with a changeable root element.
This can let u passing other component as the root element like
Comp<Comp1>
.But u can not use basic HTML elements like this
Comp<div>
sincediv
is not a component.But with a dirty fix:
Now u can pass it like
Comp<Div>
.That's too dirty and there maybe better solution for this.
Beta Was this translation helpful? Give feedback.
All reactions