Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FWIW, using React or whatever makes it more obvious that you're making these mistakes because your event handlers are attached right on the "HTML" element. It makes it easy to spot because you see

    <div className="button" onClick={handler}>
and it immedaitely sticks out as a mistake. Because its easier to statically understand these mistakes, theres even tooling to automate detecting some of them as you type https://www.npmjs.com/package/eslint-plugin-jsx-a11y


> FWIW, using React or whatever makes it more obvious that you're making these mistakes because your event handlers are attached right on the "HTML" element. It makes it easy to spot because you see

> <div className="button" onClick={handler}>

> and it immedaitely sticks out as a mistake. Because its easier to statically understand these mistakes, theres even tooling to automate detecting some of them as you type https://www.npmjs.com/package/eslint-plugin-jsx-a11y

I'm not sure how you got that out of

> I have seen an increase in unknowingly doing so by importing a calendar widget or similar without reviewing it.

I'm referring to:

    <div class="div-button" onclick="clickHandler()" />
VS:

    <SomeGreatNpmWidget onClick={clickHandler} />
The point of using components is so that you don't have to look under the covers to understand them at a high level, but that also means if you don't look you don't see how they're breaking accessibility.


Got it from the first part

> Using React or whatever does not prevent you from doing this, and in fact makes it less obvious to anyone doing a cursory review

Sure. From that level it might not be apparent, but within that component the mistake would be immediately obvious, on a cursory glance. Again, I don’t think React or whatever makes this less obvious.

But really, this just isn’t a problem I’ve seen in practice. Because of good tooling, and the ease of doing things the right way, I think the majority do it well. Those that don’t were going to fuck it up regardless of the framework or paradigm.


Depends on how far you are linting it? If you lint your node_packages folder you may still catch these.


When was the last time you removed a dependency due to lint errors? How about your coworkers?


If my point was to have accessible code, then I think I would care about not using components that are inaccessible.


Yes, it's certainly cheaper to ignore usability.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: