It would render the same way. Basically everything you pass to the prop icon will be rendered in the Button component in the same way as using the prop children.
In this article I simply chose to have the icon wrapper on the Button component because of the css classes I would apply. However I could pass the span along with the icon component and I would just have to remove the conditional rendering (because if the prop icon had no content to render, it wouldn't even take up space in the dom).
I hope I understood your statement 😬
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It would render the same way. Basically everything you pass to the prop icon will be rendered in the Button component in the same way as using the prop children.
In this article I simply chose to have the icon wrapper on the Button component because of the css classes I would apply. However I could pass the span along with the icon component and I would just have to remove the conditional rendering (because if the prop icon had no content to render, it wouldn't even take up space in the dom).
I hope I understood your statement 😬