From 9e36c4abb056a4f14d97b28d4a6fc3154ccc137e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 21 Mar 2024 23:38:55 +0000 Subject: [PATCH] Pull useQueryClient-dependent code down in App.native --- src/App.native.tsx | 48 ++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/App.native.tsx b/src/App.native.tsx index 7eccb84ec6..b9e9a5eca0 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -53,12 +53,10 @@ SplashScreen.preventAutoHideAsync() function InnerApp() { const {isInitialLoad, currentAccount} = useSession() const {resumeSession} = useSessionApi() - const queryClient = useQueryClient() const theme = useColorModeTheme() const {_} = useLingui() useIntentHandler() - useNotificationsListener(queryClient) // init useEffect(() => { @@ -78,25 +76,27 @@ function InnerApp() { // Resets the entire tree below when it changes: key={currentAccount?.did}> - - - - - - - {/* All components should be within this provider */} - - - - - - - - - - - - + + + + + + + + {/* All components should be within this provider */} + + + + + + + + + + + + + @@ -105,6 +105,12 @@ function InnerApp() { ) } +function PushNotificationsListener({children}: {children: React.ReactNode}) { + const queryClient = useQueryClient() + useNotificationsListener(queryClient) + return children +} + function App() { const [isReady, setReady] = useState(false)