const toggleButtonProps = {
key: index,
selected
};
if (props.disabled) toggleButtonProps.disabled = props.disabled;
Hot tip!! Try to challenge yourself to not imperatively update an object or array when you can use ES6 syntax to declare your logic at initialization/object creation time. The progression of developer into declarative/functional programming looks like this: