React and TypeScript
Exhaustiveness with never
Assign the remaining narrowed value to never to detect missing cases.
Formal Syntax & Structure
react syntaxreact
const impossible: never = stateWorking Example
Example Snippetreact
const impossible: never = state