how to shorten this
Unanswered
American Chinchilla posted this in #help-forum
American ChinchillaOP
i have this case
i tried
<PeopleIcon fill={clients > 0 ? "#003366" : undefined} />i tried
<PeopleIcon fill={clients > 0 && "#003366"} /> but it saysType 'false | "#003366"' is not assignable to type 'string | undefined'.
Type 'boolean' is not assignable to type 'string'.3 Replies
Netherland Dwarf
Hmm why do you want to shorten it- i think this is as close as you can shorten
Shorten code isnt always the best.
Its always better to have readable code over fancy short code