I am working on a react project. I have made some changes to the way we render content to a screen and am now having a problem finding a solution.
I have a variable that returns text dependent on its content. If the variable is empty, which is its default state, we say that no data was found. If we have some data we render the data. The problem is, that I need to set a default value to the variable so it does not show no data was found when it is analyzing.
I have tried using state to set a analyzed flag but can't seem to get it to work?
So for example:
let filterWhatToShowUser =
// here we filter through the data and determine what the result of filterWhatToShowUser is shown to the user
);
JSX
if there is data ?
<div>Show this</div>
:
<div>Show this when the object is empty</div>
:
<div>Show this whilst the object is empty but evaluating</div>