Providing Default UI Elements

We'll now make our open source library more user-friendly and convenient by allowing export of default UI elements,

Exporting Default Elements

If the user is reaching out for an Expandable OS library, like the one we made in the last lesson, they’ll need the custom logic you’ve extracted into a reusable hook. They’ll also need to render some UI elements.

You could also export some default Header, Body and Icon elements built to make their styling more configurable.

This sounds as if we can reuse the components we built earlier. However, we need to do some refactoring.

The child elements for the compound component required access to some context object. We may get rid of that and solely base the contract on props.

Get hands-on with 1400+ tech skills courses.