3 ms·
I use this operator all the time in a similar but not quite the same way: <input type=“text” defaultValue={user.email ?? “”}> The user is an entity from the D
by flufluflufluffy 10mo ago
I use this operator all the time in a similar but not quite the same way:
<input type=“text” defaultValue={user.email ?? “”}>
The user is an entity from the DB, where the email field is nullable, which makes perfect sense. The input component only accepts a string for the defaultValue prop. So you coalesce the possible null to a string.