I tried to write ternary operator with spread syntax and copy two objects. Is it possible to use ternary operator with spread syntax inside with literal objects? My code works okay, I just want to optimize it.
hintStyle: disabled ? {...globalStyles.hint, ...globalStyles.hintDisabled} : globalStyles.hint,
I want to write like this:
hintStyle: {...globalStyles.hint, {disabled ? ...globalStyles.hintDisabled : {}}},
{disabled ? ...globalStyles.hintDisabled : {}}
– Schreck