A Compromised Solution: Tell the Truth
Learn how to define all possible values of the context using union.
We'll cover the following
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 1400+ tech skills courses.