# Ciclo de vida do app e execução em segundo plano (React Native) > AppState, foreground/background transitions, headless JS, background fetch, deep links, universal links - 20 perguntas de entrevista - Mid-Level - [Perguntas de entrevista: React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista.md) ## 1. Quais são os três estados possíveis retornados por AppState.currentState no React Native? **Resposta** AppState.currentState retorna um de três estados: 'active' (o app está em primeiro plano e interativo), 'background' (o app está em segundo plano mas potencialmente ativo) e 'inactive' (estado de transição no iOS, por exemplo ao exibir a visualização de multitarefa). No Android, o estado 'inactive' é raro porque a transição é direta entre 'active' e 'background'. ## 2. Qual método deve ser usado para escutar as mudanças de estado da aplicação com AppState? **Resposta** O método AppState.addEventListener('change', callback) permite escutar as mudanças de estado da aplicação. O callback recebe o novo estado ('active', 'background' ou 'inactive') como parâmetro. É importante remover o listener usando o método remove() retornado por addEventListener durante a limpeza para evitar vazamentos de memória. ## 3. Quando o estado 'inactive' normalmente ocorre no iOS? **Resposta** O estado 'inactive' no iOS ocorre durante transições breves: ao exibir a central de controle, a central de notificações, a tela de multitarefa (toque duplo no Home) ou durante uma chamada recebida. É um estado intermediário onde o app está visível mas não interativo. No Android, esse estado raramente é observado, pois a transição entre 'active' e 'background' é direta. ## Mais 17 perguntas disponiveis - Como implementar corretamente um listener de AppState em um useEffect? - O que é um Headless JS Task no React Native? Cadastre-se gratis: https://sharpskill.dev/pt/login ## Outros temas de entrevista React Native - [Fundamentos de JavaScript](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/javascript-essentials.md): 25 perguntas, Junior - [Fundamentos do React](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/react-fundamentals.md): 20 perguntas, Junior - [Fundamentos do React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/react-native-basics.md): 22 perguntas, Junior - [React Hooks](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/react-hooks.md): 20 perguntas, Junior - [TypeScript para React e React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/typescript-for-react-native.md): 22 perguntas, Junior - [Componentes e API do React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-components-api.md): 20 perguntas, Junior - [Estilização e Layout no React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-styling-layout.md): 18 perguntas, Junior - [Navegação no React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-navigation.md): 22 perguntas, Mid-Level - [Gerenciamento de Estado no React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-state-management.md): 24 perguntas, Mid-Level - [Networking e API no React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-networking-api.md): 20 perguntas, Mid-Level - [Persistência de dados](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-data-persistence.md): 20 perguntas, Mid-Level - [Formulários e validação](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-forms-validation.md): 18 perguntas, Mid-Level - [Animações do React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-animations.md): 22 perguntas, Mid-Level - [Native Modules & Bridge](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-native-modules.md): 20 perguntas, Mid-Level - [Código específico de plataforma](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-platform-specific-code.md): 18 perguntas, Mid-Level - [Permissões e APIs de dispositivo](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-permissions-apis.md): 20 perguntas, Mid-Level - [Push Notifications](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-push-notifications.md): 18 perguntas, Mid-Level - [Testing no React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-testing.md): 20 perguntas, Mid-Level - [Debugging de React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-debugging.md): 18 perguntas, Mid-Level - [Build & Deployment](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-build-deployment.md): 20 perguntas, Mid-Level - [Expo vs React Native Bare](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/expo-vs-bare-rn.md): 18 perguntas, Mid-Level - [Otimização de desempenho](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-performance-optimization.md): 24 perguntas, Senior - [Gerenciamento de memória](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-memory-management.md): 20 perguntas, Senior - [Architecture Patterns](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-architecture-patterns.md): 22 perguntas, Senior - [New Architecture do React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-new-architecture.md): 24 perguntas, Senior - [Melhores Práticas de Segurança](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-security-best-practices.md): 20 perguntas, Senior - [Offline-First Architecture](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-offline-first.md): 20 perguntas, Senior - [CI/CD React Native](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-ci-cd.md): 20 perguntas, Senior - [Monorepo e compartilhamento de código](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-monorepo-architecture.md): 18 perguntas, Senior - [Tópicos avançados](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-advanced-topics.md): 22 perguntas, Senior - [Autenticação e gerenciamento de sessões](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-auth-session-management.md): 22 perguntas, Mid-Level - [Monitoring & Crash Reporting](https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-monitoring-crash-reporting.md): 20 perguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/pt/technologies/react-native/perguntas-entrevista/rn-app-lifecycle-background