I can't seem to get TypeScript to recognize that types with | null
are nullable. Take a look at the example below where I define the type:
type A = {
b: {
c: number;
d: string;
} | null;
};
When I hover over b
, it doesn't indicate that it could be null. This lack of indication persists when I use the type elsewhere in my code.
https://i.sstatic.net/N5Kix.png
Has anyone encountered this issue before and found a solution?