|
|
|
|
|
by dcd0101
3539 days ago
|
|
I'm inclined to agree on all these points, but I do end up doing most of these things now, in one way or another. For loops I'll create a collection of items in a function (usually done with map against a prop collection) and drop that variable in my JSX. Basically the same for conditionals. If I want a thing, a var gets a component assigned. Otherwise it's null. Are these bad patterns, as is? |
|
Unfortunately if control flow gets bolted onto JSX we can expect to see a lot less of this. Others will assume that this is the way business is done. That is, creating hundreds of lines of hard to follow conditionalized pseudo XML. I realize this already occurs in more bastardized forms, but it shouldn't be encouraged by new language features.