3

I need to have a "button" as in a clickable element that performs an action. On the web I would normally use an actual button element: <button>Click me</button>

However in React Native the Button component isn't very stylable, so most people use another element eg TouchableOpacity.

If I use TouchableOpacity then React Native Web does set data-focusable="true" and tabindex="0", however it doesn't set the role to be button. Is it therefore not ideal in terms of accessibility? If so, then is there a more accessable way to have buttons in React Native Web?

Evanss
  • 23,390
  • 94
  • 282
  • 505

0 Answers0