Actually I'd do it another way than his ideas, and his conditional rendering can produce a problem, not because conditional rendering, but because of the way how conditional rendering is used there.
I think to render anything shouldn't happen at all if there is no data.
In most cases, he should check if the length is bigger than zero to render even a container, not render even ul element, but show some msg about no items.
I'm a big fan of the ternary operator, but it's a good idea in some cases, definitely shouldn't be used as a fix for every case.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good point!
Actually I'd do it another way than his ideas, and his conditional rendering can produce a problem, not because conditional rendering, but because of the way how conditional rendering is used there.
I think to render anything shouldn't happen at all if there is no data.
In most cases, he should check if the length is bigger than zero to render even a container, not render even ul element, but show some msg about no items.
I'm a big fan of the ternary operator, but it's a good idea in some cases, definitely shouldn't be used as a fix for every case.