We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 820bb81 commit caf6556Copy full SHA for caf6556
docs/framework/react/react-native.md
@@ -166,11 +166,21 @@ export function useQueryFocusAware(notifyOnChangeProps?: NotifyOnChangeProps) {
166
)
167
168
return () => focusedRef.current
169
+}
170
+```
171
+
172
+Example usage:
173
174
+```tsx
175
+function MyComponent() {
176
+ const isFocused = useQueryFocusAware()
177
- useQuery({
178
+ const { dataUpdatedAt } = useQuery({
179
queryKey: ['key'],
180
queryFn: () => fetch(...),
- enabled: () => focusedRef.current,
181
+ enabled: isFocused,
182
})
183
184
+ return <Text>DataUpdatedAt: {dataUpdatedAt}</Text>
185
}
186
```
0 commit comments