const BUTTON_TYPE_CLASSES = { base : 'base', inverted : 'inverted' } const getButton = (buttonType) => ({ [BUTTON_TYPE_CLASSES.base] : BaseComponent, [BUTTON_TYPE_CLASSES.inverted] : InvertedComponent, }[buttonType]);Entiendo lo que significan estos bloques de código. Pero no sé qué funciona entre paréntesis en el objeto de la función getButton.
¿Por qué no usar solo BUTTON_TYPE_CLASSES.base : BaseComponent... ? ¿Por qué usar [BUTTON_TYPE_CLASSES.base]: BaseComponent...?