TP-65182 | State change remove from App.tsx
This commit is contained in:
25
App.tsx
25
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,
|
||||
});
|
||||
}}
|
||||
>
|
||||
<StatusBar backgroundColor={COLORS.BACKGROUND.INDIGO_DARK} />
|
||||
|
||||
Reference in New Issue
Block a user