New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRAWER ENCERRA O APLICATIVO #11908
Comments
Hey @Giebmeyer! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro. The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue. You can provide a repro using any of the following:
A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected. Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information. You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro. |
The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Please add a minimal reproducer. |
REPRODUTOR MINIMO:
AppRegistry.registerComponent(appName, () => App); App.tsx (Já tentei mudar para .js para ver se alterada o resultado, mas sem sucesso):
babel.config.js:
`
} allprojects { build.gralde (app): `apply plugin: 'com.android.application' def archiveBuildTypes = ["release", "debug"]; import com.android.build.OutputFile /**
project.ext.react = [ project.ext.reanimated = [ // apply from: '../../node_modules/react-native/react.gradle' /**
/**
/**
/**
/**
android {
} dependencies {
} // Run this once to be able to run the application with BUCK apply from: file('../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle'); applyNativeModulesAppBuildGradle(project) MainActivity.java: `package br.inf.visualsoftware.vsapp; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity {
@OverRide MainApplication.java: `package br.inf.visualsoftware.vsapp; import com.facebook.react.bridge.JSIModulePackage; |
Adicionado no comentário acima. |
Add a GitHub repo link or expo snack. |
The project is private and for-profit. Furthermore, I can't import it into expo snack because not all dependencies are not compatible with expo. Is there any other way? |
Create a new github project with your comment above. |
Ajustado. \android\app\build.gradle project.ext.react = [ |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Current behavior
Todos os pacotes são instalados com sucesso ao rodar o comando "yarn".
O aplicativo é contruido com sucesso tambem, entretanto, recebo os erros a seguir quando o aplicativo tenta construir a tela que possui o drawer "<Stack.Screen name="Home" component={DrawerRoutes} />":
`import React, { useContext } from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import Authentication from '../pages/Authentication';
import LoginToken from '../pages/LoginToken';
import Login from '../pages/Login';
import Logout from '../pages/Logout';
import AddSalesBudgets from '../pages/AddSalesBudgets';
import AddPreSales from '../pages/AddPreSales';
import AddServiceOrders from '../pages/AddServiceOrders';
import AddDoNotSells from '../pages/AddDoNotSells';
import AddMaintenances from '../pages/AddMaintenances';
import AddStockFixes from '../pages/AddStockFixes';
import AddProductsSalesBudgets from '../pages/AddProductsSalesBudgets';
import AddServicesSalesBudgets from '../pages/AddServicesSalesBudgets';
import AddObjectServiceOrders from '../pages/AddObjectServiceOrders';
import AddProductsPreSales from '../pages/AddProductsPreSales';
import AddProductsInventories from '../pages/AddProductsInventories';
import AddProductsMaintenances from '../pages/AddProductsMaintenances';
import AddProductsStockFixes from '../pages/AddProductsStockFixes';
import SaleBudgetFinalization from '../pages/SaleBudgetFinalization';
import PreSaleFinalization from '../pages/PreSaleFinalization';
import Checklist from '../pages/Checklist';
import SendToApi from '../pages/SendToApi';
import ListClients from '../pages/ListClients';
import ListTablePrices from '../pages/ListTablePrices';
import ListFormPayments from '../pages/ListFormPayments';
import ListModalities from '../pages/ListModalities';
import ListProducts from '../pages/ListProducts';
import ListServices from '../pages/ListServices';
import ListObjects from '../pages/ListObjects';
import ListProductsInInventory from '../pages/ListProductsInInventory';
import ClientDetails from '../pages/ClientDetails';
import CheckConfiguration from '../pages/CheckConfiguration';
import Configurations from '../pages/Configurations';
import Sync from '../pages/Sync';
import DrawerRoutes from './drawerRoutes';
import ListMovementClient from '../pages/ListMovementClient';
import ListNotifications from '../pages/ListNotifications';
import ListDeliveries from '../pages/ListDeliveries';
import ListDeliveryRoutes from '../pages/ListDeliveryRoutes';
import DeliveryRouteCompleted from '../pages/DeliveryRouteCompleted';
import DeliveryRouteNotCompleted from '../pages/DeliveryRouteNotCompleted';
import SignatureDraw from '../pages/SignatureDraw';
import PreSync from '../pages/PreSync';
import ListPendingSlip from '../pages/ListPendingSlip';
import ListDeliveryFees from '../pages/ListDeliveryFees';
import Collect from '../pages/Collect';
import ListDocScannig from '../pages/ListDocScanning';
import PlanDetails from '../pages/PlanDetails';
import GetToApi from '../pages/GetToApi';
import SummarySync from '../pages/SummarySync';
import { Context as AuthContext } from '../context/authContext';
import { Context as SyncContext } from '../context/syncContext';
const Routes = () => {
const Stack = createStackNavigator();
const { stateAuth } = useContext(AuthContext);
const { stateSync } = useContext(SyncContext);
return (
<Stack.Navigator
initialRouteName="CheckConfiguration"
screenOptions={{ headerShown: false, gestureEnabled: false }}>
{!stateAuth.isConfigured || stateAuth.alterConfiguration ? (
<>
<Stack.Screen name="CheckConfiguration" component={CheckConfiguration} />
<Stack.Screen name="Configurations" component={Configurations} />
</>
) : !stateAuth.isAuthenticated ? (
<>
<Stack.Screen name="Authentication" component={Authentication} />
</>
) : stateSync.isFirstSync ? (
<Stack.Screen name="SummarySync" component={SummarySync} />
) : !stateAuth.isLogged ? (
<>
<Stack.Screen name="LoginToken" component={LoginToken} />
<Stack.Screen name="Login" component={Login} />
</>
) : !stateAuth.isSynced ? (
<Stack.Screen name="Sync" component={Sync} />
) : (
<>
<Stack.Screen name="Home" component={DrawerRoutes} />
<Stack.Screen name="PreSync" component={PreSync} />
<Stack.Screen name="AddSalesBudgets" component={AddSalesBudgets} />
<Stack.Screen name="AddPreSales" component={AddPreSales} />
<Stack.Screen name="AddServiceOrders" component={AddServiceOrders} />
<Stack.Screen name="AddDoNotSells" component={AddDoNotSells} />
<Stack.Screen name="AddMaintenances" component={AddMaintenances} />
<Stack.Screen name="AddStockFixes" component={AddStockFixes} />
<Stack.Screen name="AddProductsSalesBudgets" component={AddProductsSalesBudgets} />
<Stack.Screen name="AddServicesSalesBudgets" component={AddServicesSalesBudgets} />
<Stack.Screen name="AddObjectServiceOrders" component={AddObjectServiceOrders} />
<Stack.Screen name="AddProductsPreSales" component={AddProductsPreSales} />
<Stack.Screen name="AddProductsInventories" component={AddProductsInventories} />
<Stack.Screen name="AddProductsMaintenances" component={AddProductsMaintenances} />
<Stack.Screen name="AddProductsStockFixes" component={AddProductsStockFixes} />
<Stack.Screen name="SaleBudgetFinalization" component={SaleBudgetFinalization} />
<Stack.Screen name="PreSaleFinalization" component={PreSaleFinalization} />
<Stack.Screen name="Checklist" component={Checklist} />
<Stack.Screen name="SendToApi" component={SendToApi} />
<Stack.Screen name="ListProducts" component={ListProducts} />
<Stack.Screen name="ListServices" component={ListServices} />
<Stack.Screen name="ListObjects" component={ListObjects} />
<Stack.Screen name="ListClients" component={ListClients} />
<Stack.Screen name="ListTablePrices" component={ListTablePrices} />
<Stack.Screen name="ListFormPayments" component={ListFormPayments} />
<Stack.Screen name="ListModalities" component={ListModalities} />
<Stack.Screen name="ListProductsInInventory" component={ListProductsInInventory} />
<Stack.Screen name="ClientDetails" component={ClientDetails} />
<Stack.Screen name="Logout" component={Logout} />
<Stack.Screen name="ListMovementClient" component={ListMovementClient} />
<Stack.Screen name="ListNotifications" component={ListNotifications} />
<Stack.Screen name="ListDeliveries" component={ListDeliveries} />
<Stack.Screen name="ListDeliveryRoutes" component={ListDeliveryRoutes} />
<Stack.Screen name="DeliveryRouteCompleted" component={DeliveryRouteCompleted} />
<Stack.Screen name="DeliveryRouteNotCompleted" component={DeliveryRouteNotCompleted} />
<Stack.Screen name="SignatureDraw" component={SignatureDraw} />
<Stack.Screen name="ListPendingSlip" component={ListPendingSlip} />
<Stack.Screen name="ListDeliveryFees" component={ListDeliveryFees} />
<Stack.Screen name="Collect" component={Collect} />
<Stack.Screen name="ListDocScannig" component={ListDocScannig} />
<Stack.Screen name="PlanDetails" component={PlanDetails} />
<Stack.Screen name="GetToApi" component={GetToApi} />
<Stack.Screen name="SummarySync" component={SummarySync} />
</>
)}
</Stack.Navigator>
);
};
export default () => {
return ;
};
`
DrawerRoutes:
`import React, { useContext, useState } from 'react';
import { createDrawerNavigator } from '@react-navigation/drawer';
import IonIcon from 'react-native-vector-icons/Ionicons';
import CustomDrawer from '../components/CustomDrawer';
import { customIcon } from '../utils';
import HomeScreen from '../pages/HomeScreen';
import ListBudgets from '../pages/ListBudgets';
import ConsultPrices from '../pages/ConsultPrices';
import ConsultClients from '../pages/ConsultClients';
import ConsultInvoices from '../pages/ConsultInvoices';
import ListInventories from '../pages/ListInventories';
import ListPreSales from '../pages/ListPreSales';
import ListNotifications from '../pages/ListNotifications';
import ListDeliveries from '../pages/ListDeliveries';
import Collect from '../pages/Collect';
import ListMaintenances from '../pages/ListMaintenances';
import ListDocScanning from '../pages/ListDocScanning';
import ListStockFixes from '../pages/ListStockFixes';
import Param from '../pages/Params';
import About from '../pages/About';
import Logout from '../pages/Logout';
import PreSync from '../pages/PreSync';
import { ViewCountNumber, TextCount, ViewNotification } from './styled';
import { Context as ConfigContext } from '../context/configContext';
import { Context as PermissionContext } from '../context/permissionContext';
const Drawer = createDrawerNavigator();
export default function DrawerRoutes() {
const { stateConfig } = useContext(ConfigContext);
const { statePermission } = useContext(PermissionContext);
const [textButtonSync, setTextButtonSync] = useState('Sincronizar');
return (
<Drawer.Navigator
drawerContent={(props) => <CustomDrawer {...props} />}
screenOptions={{
headerShown: false,
drawerStyle: {
backgroundColor: '#FCFCFC',
},
drawerActiveBackgroundColor: '#1FCC79',
drawerActiveTintColor: '#FFF',
drawerInactiveTintColor: '#2E3E5C',
drawerLabelStyle: {
fontFamily: 'Inter-Medium',
fontSize: 16,
marginLeft: -8,
},
drawerType: 'front',
}}>
<Drawer.Screen
name="HomeScreen"
component={HomeScreen}
options={{
title: 'Início',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'home' : 'home-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
{(statePermission.permissions?.budgetsUsar ?? true) && (
<Drawer.Screen
name="ListBudgets"
component={ListBudgets}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Orçamentos',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'document-text' : 'document-text-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
)}
{stateConfig.configurations.premium && (
<Drawer.Screen
name="ListPreSales"
component={ListPreSales}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Pré-vendas',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'cart' : 'cart-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
)}
{/* {stateConfig.configurations.premium && (
<Drawer.Screen
name="ListServiceOrders"
component={ListServiceOrders}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Ordens de serviço',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'car-sport' : 'car-sport-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
)} */}
<Drawer.Screen
name="ConsultPrices"
component={ConsultPrices}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Produtos',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'pricetags' : 'pricetags-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
{
<Drawer.Screen
name="ConsultClients"
component={ConsultClients}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Clientes',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'people' : 'people-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
}
{(statePermission.permissions?.inventoriesUsar ?? true) && (
<Drawer.Screen
name="ListInventories"
component={ListInventories}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Inventários',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'file-tray-stacked' : 'file-tray-stacked-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
)}
{stateConfig.configurations.premium &&
(statePermission.permissions?.consultInvoicesUsar ?? true) && (
<Drawer.Screen
name="ConsultInvoices"
component={ConsultInvoices}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Conf. NF-e',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'receipt' : 'receipt-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
)}
{stateConfig.configurations.premium && (
<Drawer.Screen
name="ListDocScanning"
component={ListDocScanning}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Digitalização',
drawerIcon: ({ focused }) =>
customIcon(
'MaterialCommunityIcons',
focused ? 'file-document-edit' : 'file-document-edit-outline',
28,
focused ? '#FFF' : '#2E3E5C',
),
}}
/>
)}
<Drawer.Screen
name="ListMaintenances"
component={ListMaintenances}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Trocas/Manutenções',
drawerIcon: ({ focused }) => (
<IonIcon
name={focused ? 'construct' : 'construct-outline'}
size={28}
color={focused ? '#FFF' : '#2E3E5C'}
/>
),
}}
/>
{stateConfig.configurations.premium && (
<Drawer.Screen
name="ListDeliveries"
component={ListDeliveries}
options={{
unmountOnBlur: true, // DESMONTAR TELA AO SAIR
title: 'Entregas',
drawerIcon: ({ focused }) =>
customIcon(
'MaterialCommunityIcons',
focused ? 'truck-delivery' : 'truck-delivery-outline',
28,
focused ? '#FFF' : '#2E3E5C',
),
}}
/>
)}
);
}
`
Expected behavior
O aplicativo deveria executar e apresentar a tela Home
`import React, { useContext } from 'react';
import { ScrollView } from 'react-native';
import { Header } from '../../components/Header';
import OptionHome from '../../components/OptionHome';
import { useNavigation } from '@react-navigation/native';
import { ContainerText, TextUser } from './styles';
import { Context as UserContext } from '../../context/userContext';
import { Context as PermissionContext } from '../../context/permissionContext';
import { Context as NotificationContext } from '../../context/notificationContext';
const HomeScreen = () => {
const { stateUser } = useContext(UserContext);
const { statePermission } = useContext(PermissionContext);
const { stateNotification } = useContext(NotificationContext);
const navigation = useNavigation();
return (
<>
<Header.Root>
<Header.Action icon="menu" action={() => navigation.openDrawer()} />
<Header.Title title="vsApp" />
);
};
export default HomeScreen;
`
Reproduction
O projeto é privado.
Platform
Packages
Environment
{
"scripts": {
"android": "react-native run-android",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
},
"dependencies": {
"@iconscout/react-unicons": "^2.0.0",
"@nozbe/watermelondb": "0.25.5",
"@nozbe/with-observables": "^1.4.1",
"@react-native-clipboard/clipboard": "^1.11.1",
"@react-native-community/art": "^1.2.0",
"@react-native-community/hooks": "^2.8.1",
"@react-native-community/netinfo": "^9.4.1",
"@react-native-community/push-notification-ios": "^1.10.1",
"@react-native-masked-view/masked-view": "^0.2.6",
"@react-native-ml-kit/text-recognition": "^1.5.1",
"@react-navigation/drawer": "^6.6.15",
"@react-navigation/native": "^6.1.3",
"@react-navigation/stack": "^6.3.29",
"@types/react-native": "^0.67.6",
"@types/react-native-snap-carousel": "^3.8.5",
"@types/styled-components": "^5.1.32",
"axios": "^1.5.1",
"base-64": "^1.0.0",
"cap": "^0.2.1",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.6",
"deprecated-react-native-prop-types": "^2.3.0",
"masks-br": "^1.0.1",
"npx": "^10.2.2",
"pdf-lib": "^1.17.1",
"react": "18.2.0",
"react-native": "0.72.7",
"react-native-app-intro-slider": "^4.0.4",
"react-native-background-actions": "^3.0.1",
"react-native-barcode-mask": "^1.2.4",
"react-native-blob-util": "^0.19.1",
"react-native-bouncy-checkbox": "^3.0.2",
"react-native-date-picker": "^4.2.5",
"react-native-device-info": "^9.0.2",
"react-native-dialog-input": "^1.0.8",
"react-native-expo-fancy-alerts": "^2.1.1",
"react-native-file-viewer": "^2.1.5",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.14.0",
"react-native-html-to-pdf": "^0.12.0",
"react-native-image-picker": "^4.8.4",
"react-native-image-viewing": "^0.2.2",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-modal": "^13.0.1",
"react-native-modalize": "^2.1.1",
"react-native-orientation-locker": "^1.5.0",
"react-native-pdf": "^6.7.1",
"react-native-permissions": "^3.6.1",
"react-native-progress": "^4.0.2",
"react-native-push-notification": "^8.1.1",
"react-native-qrcode-svg": "^6.2.0",
"react-native-reanimated": "3.8.1",
"react-native-safe-area-context": "^4.2.5",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "^3.13.1",
"react-native-share": "8.2.1",
"react-native-signature-canvas": "^4.5.0",
"react-native-snackbar": "^2.4.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-sound-player": "^0.13.2",
"react-native-stopwatch-timer": "^0.0.21",
"react-native-super-grid": "^5.0.0",
"react-native-svg": "^15.1.0",
"react-native-switch-toggles": "^1.0.1",
"react-native-vector-icons": "^9.2.0",
"react-native-version-check": "^3.4.7",
"react-native-vision-camera": "^3.9.0",
"react-native-walkthrough-tooltip": "^1.6.0",
"react-native-webview": "^12.0.2",
"react-native-worklets-core": "^0.3.0",
"styled-components": "^5.3.5",
"sync": "^0.2.5"
},
"peerDependencies": {
"react-native-vision-camera": "",
"react-native-worklets-core": ""
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-decorators": "7.21.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native-community/eslint-config": "^3.0.1",
"@react-native/eslint-config": "^0.72.2",
"@react-native/metro-config": "^0.72.11",
"@testing-library/jest-native": "^5.4.2",
"@testing-library/react-native": "^12.0.1",
"@tsconfig/react-native": "^3.0.0",
"@types/react": "^18.0.24",
"@types/react-native-vector-icons": "^6.4.10",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.76.8",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
"jest": {
"preset": "react-native",
"setupFilesAfterEnv": [
"@testing-library/jest-native/extend-expect"
]
},
"engines": {
"node": ">=16"
}
}
The text was updated successfully, but these errors were encountered: