How to allow only certain string values for component props in Nextjs using TypeScript?
Originally Published Here ๐!
To allow only certain string values for a prop when using Nextjs with Typescript, you can make use of the string literal union type in TypeScript.
TL;DR
/* Square.tsx file */
// String literal Union Type
// for colors `...
melvingeorge-me.hashnode.dev3 min read