4 ms·
Afaik twitter uses (some form of) react-native-web. So I guess it's because: https://github.com/necolas/react-native-web/pull/556 https://github.com/necolas/re
by codeptualize 5y ago
Afaik twitter uses (some form of) react-native-web.
So I guess it's because: https://github.com/necolas/react-native-web/pull/556 https://github.com/necolas/react-native-web/pull/556
Basically some browsers don't support display flex on certain elements like button, using a div instead of a button solves that issue.
Generally: I would suggest to use a button tag unless you run into issues (and know what you are doing).
I don't think using `<div role="button">` is perse worse as long as you implement all the behaviour and styling of the button element like focus, keyboard events and similar.
For juniors, buttons should be taught as the way to go, as with many things in web it's about understanding the pros and cons and knowing why you do something or not. If you don't have a lot of experience, stay away from reimplementing the button tag.
- SimeVidas 5y agoLooks like this could be it.