Open literat opened 2 years ago
I remember we also had it this way in RUI. Or to be precise, we had used the object definition in the app, but we changed it to TabItem
because (maybe?) the code was easier to read and work with. Maybe we had done something wrong before but I just want to note I have already done the exactly opposite change 🙂. I only wish I could remember the reason 😞.
Originally we had this:
-Tabs.propTypes = {
- children: PropTypes.node.isRequired,
- id: PropTypes.string.isRequired,
- tabs: PropTypes.arrayOf(PropTypes.shape({
- icon: PropTypes.node,
- id: PropTypes.string.isRequired,
- isActive: PropTypes.bool,
- link: PropTypes.string.isRequired,
- title: PropTypes.string.isRequired,
- })).isRequired,
-};
Then we moved Tabs
to RUI:
Inspiration came from https://react-spectrum.adobe.com/react-spectrum/Tabs.html#content where are tabs created based on a defined object. Maybe we can simplify API to do so only using
<Tabs items={items} />
.