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
I’ve just come to the idea that we can simplify our components API if we utilise context technique in the library on the top level. For the instance, we have:
<Card><Card.Title>I'm a card!</Card.Title></Card>
that turns into
<divclass="card"><h2class="card-title">I'm a card!</h2></div>
My use case above is pretty simple and seems to be not worth it. I not sure either in this.
Apart from Heading replacing the Card.Title along with Section.Title we may have in the future, it looks more convenient for implicit passing classes to:
Icon that is descendent of the TextField, Select or Menu
similar to Button that is descendet of the TextField
I am pretty sure, there are other cases. However, since it's implicit, it's not obvious: very easy to use, very hard to debug.
However, we should investigate React Context API performance. If it's bad, we should drop the idea, unfortunately. Especially interesting it the performance of combining many contexts.
The idea is nice. Maybe it would be worth if you created a proof of concept. The API would be simplified a lot I am just a little bit worried though it simplifies the final API it also would complicate the design development itself.
I’ve just come to the idea that we can simplify our components API if we utilise context technique in the library on the top level. For the instance, we have:
that turns into
The proposal
Potentially, we can have a bit easier API like
that produces the same result.
Simple implementation
Use cases
My use case above is pretty simple and seems to be not worth it. I not sure either in this.
Apart from
Heading
replacing theCard.Title
along withSection.Title
we may have in the future, it looks more convenient for implicit passing classes to:Icon
that is descendent of theTextField
,Select
orMenu
Button
that is descendet of theTextField
I am pretty sure, there are other cases. However, since it's implicit, it's not obvious: very easy to use, very hard to debug.
@Joozty what do you think?
The text was updated successfully, but these errors were encountered: