useSuspenseQuery was released in v3.8.0-alpha versions with a limited API surface area. We've received feedback that there is a need for the skip option to conditionally avoid running the query.
Summary of changes
- Add an optional
skip option to the useSuspenseQuery options
- Set the return type of
data to TData | undefined when skip is present in options.
- When
skip is present, only suspend when skip is false.
Feedback:
useSuspenseQuerywas released in v3.8.0-alpha versions with a limited API surface area. We've received feedback that there is a need for theskipoption to conditionally avoid running the query.Summary of changes
skipoption to theuseSuspenseQueryoptionsdatatoTData | undefinedwhenskipis present inoptions.skipis present, only suspend whenskipisfalse.Feedback:
useSuspenseQuery#10323 (comment)