DEV Community 👩‍💻👨‍💻

Discussion on: Create react subcomponents in a simple way!

Collapse
 
lexswed profile image
Lex Swed

It's a totally valid approach, I'm just complaining on the browser capabilities to write custom components with "children" being handled automatically :)
Like, would be nice if we had not only

<select>
  <option value="1">First</option>
</select>
Enter fullscreen mode Exit fullscreen mode

But also

<card>
  <header>Title</header>
</card>
Enter fullscreen mode Exit fullscreen mode

that would handle incorrect children. I know web-components API exist and there are good examples of it, but it's far from being usable for smaller-scale projects.

Thread Thread
 
ms_yogii profile image
Yogini Bende Author

True that!