I recently reviewed a contribution to a shared React module where one developer used const objects instead of enums for accepted prop values.
My first reaction was simple:
Why not enums?
I like enums for this kind of thing. Maybe too much.
For me, an enum is a clear and determined way to declare a list of accepted values. It says: here is the list, this is the source of truth, use these values everywhere.






