In every project we end up creating a custom Button component. We can already do this at the level of our template.
Expected outcome
- Button is implemented using the
Pressable primitive
- Button expects text label and/or icon
- We have a
disabled state for non active buttons
- We handle the press event by changing opacity
- We offer two flavours: Primary (a button with clear border outline and a background colour) and Secondary (just text on transparent background, like we have currently "increment counter")
- Button accepts a
style property to overwrite styles when needed (that allows us to easily create derivative button classes from it)
Notes
In every project we end up creating a custom Button component. We can already do this at the level of our template.
Expected outcome
Pressableprimitivedisabledstate for non active buttonsstyleproperty to overwrite styles when needed (that allows us to easily create derivative button classes from it)Notes