2 ms·
In what sense is it not declarative anymore? I usually use tests at the top of the render function to make sure that data is there, and return cleanly if it is
by inimino 10y ago
In what sense is it not declarative anymore?
I usually use tests at the top of the render function to make sure that data is there, and return cleanly if it isn't. It just makes development easier as React components tend to get re-used. Within the data.person, in your example, the caller should make sure that it is complete, or pass nothing at all.
In the case you show I would either return <Spinner/> or the content, but never nest them. Have a conditional and two return statements, or one return statement with a ternary operator.