setStore TypeScript Issue
I have a object store that has an interface like this:
type1 looks like this:
type2 looks like this:
Now I have a components where I pass in the following props struct
Within the component I make calls like:
(where props.id = "object1" or "object2")
These do not create any typescript error.
When I make a call like this:
(where props.id = "object2")
I get an error like this:
The code runs fine without error, so I feel like I am not actually using setStore incorrectly.
Why doesn't TypeScript recognize "invert" as valid Part in this situation? Is there any way I can fix this without supressing the TypeScript error?
type1 looks like this:
type2 looks like this:
Now I have a components where I pass in the following props struct
Within the component I make calls like:
(where props.id = "object1" or "object2")
These do not create any typescript error.
When I make a call like this:
(where props.id = "object2")
I get an error like this:
The code runs fine without error, so I feel like I am not actually using setStore incorrectly.
Why doesn't TypeScript recognize "invert" as valid Part in this situation? Is there any way I can fix this without supressing the TypeScript error?
