From be54ff65721dcbb259b242c3c2e5e844c2b07f7d Mon Sep 17 00:00:00 2001 From: yashmantri Date: Fri, 10 May 2024 12:32:34 +0530 Subject: [PATCH] TP-65182 | State change remove from App.tsx --- App.tsx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/App.tsx b/App.tsx index 92f64511..6061900b 100644 --- a/App.tsx +++ b/App.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import { AppState, LogBox, @@ -6,7 +6,6 @@ import { PermissionsAndroid, Platform, StatusBar, - NativeModules, } from 'react-native'; import { Provider } from 'react-redux'; import { init as initApm } from '@cobo/apm-rum-react-native'; @@ -76,8 +75,6 @@ const PERMISSION_CHECK_POLL_INTERVAL = 5 * MILLISECONDS_IN_A_SECOND; function App() { const [permissions, setPermissions] = React.useState(true); - const [routeName, setRouteName] = useState('Unknown'); - const askForPermissions = async () => { const permissionsToRequest = await getPermissionsToRequest(); if (Platform.OS === 'android') { @@ -167,19 +164,15 @@ function App() { ref={navigationRef} onStateChange={async (state) => { const currentRouteName = getActiveRouteName(state); - if (routeName !== currentRouteName) { - await analytics().logScreenView({ - screen_name: currentRouteName, - screen_class: currentRouteName, - }); + await analytics().logScreenView({ + screen_name: currentRouteName, + screen_class: currentRouteName, + }); - await analytics().logEvent('screen_view', { - screen_name: currentRouteName, - screen_class: currentRouteName, - }); - - setRouteName(currentRouteName); - } + await analytics().logEvent('screen_view', { + screen_name: currentRouteName, + screen_class: currentRouteName, + }); }} >