Apart from using Typescript? What’s the benefit? Are you suggesting to use typescript for better components or to use enum? If its not typescript, how do we go about it.
I'm using enum because of TypeScript though. If you're not using TS you can do:
exportconst sizes = {
MD: 'md',
// etc
}
The benefit is that you'll have the size names or button types all in the same place. If you need to change from lg to large you only need to change it in one place.