Pega o retorno da condição:
const possibleConditions = {
true: <Element />,
false: null
};
const name = "this is my name";
const condition: boolean = name.length > 0;
return possibleConditions[condition];
Pega o retorno da condição:
const possibleConditions = {
true: <Element />,
false: null
};
const name = "this is my name";
const condition: boolean = name.length > 0;
return possibleConditions[condition];