-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
Description
Is your feature request related to a problem? Please Describe.
Please refer to #3857
Tl;dr: Button with underlying Icon and Chip with underlying Icon causes validateDOMNesting check to fail for web renders because of nested <button>.
Describe the solution you'd like
To mitigate this, I propose the following changes:
Iconneed not behave as an HTML<button>if there are noonPressor related callbacks defined.- As an extension to the above:
Iconshould not allowonPressor related callbacks in case it is used as a child component of aButton - [Optional, but I think this is good]
Chipneed not behave as aButtonbecause according to the docs: "Chips are compact elements that represent an input, attribute, or action. They may display text, icons, or both". My understanding is that they can also be used as "discrete labels/tags" to associate some sort of metadata (similar to "Labels" in Jira or "Multi-Select Tags" in Notion). In that case,Chipcan have a clickableIcon.
Describe alternatives you've considered
<Icon.Button> from react-native-vector-icons conditionally be a functional replacement to <Button icon={}>, but it is less flexible.
Additional context
yuryibaravy, christopherleja and alistertb