I have a class that has a table in it. Problem is, amount of columns in it may vary. And when no data is loaded to the table, I need to display a message here something like "no data", using
You can use the React Children utility to determine if there are any elements inside (considering you had a parent
Table element that would wrap
TableHeader elements). I think that would be the most appropriate approach here.
That way you can dynamically render content and also be able to tell how many elements you need to render.
What you might be looking for more exactly would be the React.Children.count.