You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some issues have been brought to our attention that the useSubscriptionAPI doesn't have an option of ignoreResults, similar to the useMutationAPI.
Issue
Unfortunately, unlike useMutation, there is no "magic parameter" like ignoreResults, and a component will be rendered each time you get new data on subscription. useSubscription returns a value, and because it does, that means we need to update it, which requires components to re-render. Whereas useMutation allows someone to avoid the re-renders by passing an ignoreResults option.
Purpose
We could offer an ignoreResults option in useSubscription which would not return a value from useSubscription thereby avoiding re-renders This would be useful to allow a developer to to not re-render a component on certain occasions if they wish.
Details
Name: ignoreResults
Type boolean
Functionality: If true, the subscription's data property is not updated with the subscription's result.
Overview
Some issues have been brought to our attention that the
useSubscription
API doesn't have an option of ignoreResults, similar to theuseMutation
API.Issue
Unfortunately, unlike
useMutation
, there is no "magic parameter" likeignoreResults
, and a component will be rendered each time you get new data on subscription.useSubscription
returns a value, and because it does, that means we need to update it, which requires components to re-render. WhereasuseMutation
allows someone to avoid the re-renders by passing anignoreResults
option.Purpose
We could offer an
ignoreResults
option inuseSubscription
which would not return a value fromuseSubscription
thereby avoiding re-renders This would be useful to allow a developer to to not re-render a component on certain occasions if they wish.Details
References
The text was updated successfully, but these errors were encountered: