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
Currently there is no way to know if you forgot deps besides testing. We would love to use react-hooks/exhaustive-deps to recognise the missing deps in the useQuery function.
Solution
If we move the type argument as the last one, so example usage of useQuery:
Then react-hooks/exhaustive-deps correctly recognises missing deps (as it expects deps to be on second position and callback to be on the first one like in useEffect).
Alternatives
No alternatives really. For our code base we copy-pasted useQuery source code and modified it to suit our needs, but I think it would be really beneficial to all developers using @realm/react.
Maybe alternative is to fork react-hooks/exhaustive-deps and make it work for realm-hooks :)
How important is this improvement for you?
Fairly niche but nice to have anyway
Feature would mainly be used with
Atlas Device Sync
The text was updated successfully, but these errors were encountered:
Problem
Currently there is no way to know if you forgot
deps
besides testing. We would love to usereact-hooks/exhaustive-deps
to recognise the missing deps in theuseQuery
function.Solution
If we move the
type
argument as the last one, so example usage of useQuery:Then
react-hooks/exhaustive-deps
correctly recognises missing deps (as it expects deps to be on second position and callback to be on the first one like in useEffect).Alternatives
No alternatives really. For our code base we copy-pasted
useQuery
source code and modified it to suit our needs, but I think it would be really beneficial to all developers using @realm/react.Maybe alternative is to fork
react-hooks/exhaustive-deps
and make it work forrealm-hooks
:)How important is this improvement for you?
Fairly niche but nice to have anyway
Feature would mainly be used with
Atlas Device Sync
The text was updated successfully, but these errors were encountered: