Hacker News new | ask | show | jobs
by RobertRoberts 3021 days ago
>My argument about the attribute is not invalid because they are doing it the wrong way.

The problem with this argument is that just a few years ago everything ReactJS does now was the wrong way, but for some reason today, it's the best way. So which is it?

It seems to me, that unless it's broken, or goes against an explicit rule from the browser/code designers of html/css etc... it's totally valid. And if it doesn't "feel correct", then maybe it's a trend waiting to happen. <sigh>inline javascript styles</sigh>

1 comments

What was ReactJS doing a few years ago that was wrong then but correct now? Since I don't know what that is, did the spec change during that time?

As far as I know right now, custom attributes goes against the html standard.

>What was ReactJS doing a few years ago that was wrong then but correct now?

Inline styles for one... created with javascript no less. This was totally verboten not long ago. But then became a "best practice" only because React started doing it.

I disagree, inline styles is never a "best practice" no matter what the reason or who does it. It happens from time-to-time due to necessity, but that doesn't make it best practice. In this case, React is simply doing it wrong.