From 6c8f043e370393d593c14dc40cff86b062fc5c52 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 17 Nov 2023 06:20:08 +0000 Subject: [PATCH] Freeze inactive screens (#1949) --- src/App.native.tsx | 2 ++ src/App.web.tsx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/App.native.tsx b/src/App.native.tsx index af4c3be8..e1db6df8 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -6,6 +6,7 @@ import {RootSiblingParent} from 'react-native-root-siblings' import * as SplashScreen from 'expo-splash-screen' import {GestureHandlerRootView} from 'react-native-gesture-handler' import {QueryClientProvider} from '@tanstack/react-query' +import {enableFreeze} from 'react-native-screens' import 'view/icons' @@ -40,6 +41,7 @@ import {messages} from './locale/locales/en/messages' i18n.load('en', messages) i18n.activate('en') +enableFreeze(true) SplashScreen.preventAutoHideAsync() function InnerApp() { diff --git a/src/App.web.tsx b/src/App.web.tsx index 67fa3dcc..b1dba798 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -4,6 +4,7 @@ import React, {useState, useEffect} from 'react' import {QueryClientProvider} from '@tanstack/react-query' import {SafeAreaProvider} from 'react-native-safe-area-context' import {RootSiblingParent} from 'react-native-root-siblings' +import {enableFreeze} from 'react-native-screens' import 'view/icons' @@ -32,6 +33,8 @@ import { import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread' import * as persisted from '#/state/persisted' +enableFreeze(true) + function InnerApp() { const {isInitialLoad} = useSession() const {resumeSession} = useSessionApi()