A Compromised Solution: Tell the Truth
Learn how to define all possible values of the context using union.
Defining possible types
Another option is to tell the truth. The value of the context can either be ColorState
or undefined
:
Get hands-on with 1300+ tech skills courses.