I know this was just switched over and I don't know the behind the scenes reason, but... it was convenient to have a component. Here is an example scenario where I would like to have it:
We have a page where the primary and default button change depending on what actions the user takes (or has taken) on the page. Example: I vote, and the primary/default buttons swap based on my vote.
The problem with having separate components in React is that when we re-render after the user action we lose focus. The only way to fix this issue with the current design (that I am aware of) is to track focus in another component, re-set focus in the DOM, etc, etc. It seems messy and inconvenient when I really just want a button that is primary vs. default.
I know this was just switched over and I don't know the behind the scenes reason, but... it was convenient to have a component. Here is an example scenario where I would like to have it:
We have a page where the primary and default button change depending on what actions the user takes (or has taken) on the page. Example: I vote, and the primary/default buttons swap based on my vote.
The problem with having separate components in React is that when we re-render after the user action we lose focus. The only way to fix this issue with the current design (that I am aware of) is to track focus in another component, re-set focus in the DOM, etc, etc. It seems messy and inconvenient when I really just want a button that is primary vs. default.