My rule for creating reusable components: Honor HTML
My rule for creating reusable components: Honor HTML.
Example: A reusable Button should honor the native HTML button API.
So, don’t do this:
🚫 <Button text=“Submit” />
Do this:
✅ <Button>Submit</Button>
Honoring HTML’s API makes the component easier to understand and avoids accidentally creating an API that’s needless constraining.
The HTML APIs are mature and proven. So avoid deviating from them when creating abstractions.