News for hackers. Stuff that matters.
Re:React best practices by mattmanser on Monday May 03, 2021 @05:46PM (#27031147)
Yeah, was just looking at that and raising an eyebrow.

I've only done smaller projects in React, but in 15 years of writing programs, that instinctively looks like a pretty severe code smell.

Re:React best practices by fiddlerwoaroof on Monday May 03, 2021 @05:48PM (#27031177)
Yeah, this is the sort of situation where you want to employ some sort of polymorphism rather than a static conditional, I’d think.

In general, while some of the advice here could be useful, my experience has led me to very different opinions about structuring react.