Non-undefined placeholderData types as possibly undefined
If my
Consider the following example:
Shouldn't
If not, how can I achieve this? In other words, how can I seed this particular query observer with a known value?
(In practice, the above code does not error as far as I've tested. I also tried
placeholderData function always returns a proper result (not undefined), then why is the resulting data property typed as T | undefined?Consider the following example:
Shouldn't
placeholderData always (synchronously, without loading) stand in for data while loading/fetching/intializing/etc?If not, how can I achieve this? In other words, how can I seed this particular query observer with a known value?
(In practice, the above code does not error as far as I've tested. I also tried
initialData, but that seems to override placeholderData with flashes back to the inital value -- I want the use-the-previous-thing behavior)