When just using the defaults
key, the types are correctly assumed. But when you add a schema
it makes everything unknown
. As you can see in the following screenshot, my code errors because Property 'width' does not exist on type '{}'.
when using a schema, but it works fine when not. It causes the .get
function to return unknown
and the template type of the store becomes [key]: unknown
. (This happens even if you have defaults
along with schema
, I just removed it so it would fit into one screenshot)
Another weird thing you can see in the screenshot is that the return value of .get()
is an object that has any of the objects keys (but not any that aren't part of the objects) when the param passed into .get
doesn't exist.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too