Hi Tobias, yep, I 100% agree with you, enums are much nicer here :) I covered exactly this pattern in the next article of the "advanced ts for react devs" series :). Check it out: https://adevnadia.medium.com/advanced-typescript-for-react-developers-part-3-dc7a32a7dbb1
--
Frontend architect, coder. Love solving problems, fixing things and writing in-depth tech articles: https://www.developerway.com
Love podcasts or audiobooks? Learn on the go with our new app.