Debunking the Myth: Accessibility and React
Publikováno: 15.1.2020
I find it notable when the blog of a major accessibility-focused company like Deque publishes an article called Debunking the Myth: Accessibility and React. Mark Steadman is essentially saying if a site has bad accessibility, it ain't React... it's you. The tools are there to achieve good accessibility.
React didn't use a <div>
for a <button>
, but you did. React didn't force extra markup all over the page when you decided to not use a Fragment. React didn't … Read article
The post Debunking the Myth: Accessibility and React appeared first on CSS-Tricks.
I find it notable when the blog of a major accessibility-focused company like Deque publishes an article called Debunking the Myth: Accessibility and React. Mark Steadman is essentially saying if a site has bad accessibility, it ain't React... it's you. The tools are there to achieve good accessibility.
React didn't use a <div>
for a <button>
, but you did. React didn't force extra markup all over the page when you decided to not use a Fragment. React didn't forget to change the title of the page, because that was something you neglected.
Is it different how you have to do it in React versus how you have to do it in some other framework or CMS? Yes, it is. Different, but neither worse nor harder.
I'm optimistic that well-made React components focused on accessibility can have a positive impact on the web. Just today I was pair programming and looking at some HTML for a toggle UI in a Rails template. It had a little bug we wanted to fix, which required an HTML change. But this toggle wasn't a component, it was a chunk of HTML used in dozens of places on the site. Gosh, did I wish this part of the site was architected with proper components instead, a practice that all JavaScript frameworks endorse?
Where did the bad wrap on React come from? Well, we could debate that for days. Is it that JavaScript-focused developers never got the HTML training they needed? Maybe. Was it gnarly, unsemantic React code that was written early on that others copy and pasted too many times? Maybe. I'm not sure we'll ever know. The important thing is that we all do a better job now.
Direct Link to Article — Permalink
The post Debunking the Myth: Accessibility and React appeared first on CSS-Tricks.