React Native Networking & API
fetch API, axios, async/await, error handling, API integration, AbortController
1What is the native JavaScript method for making HTTP requests in React Native?
What is the native JavaScript method for making HTTP requests in React Native?
Antwort
fetch is the native API built into JavaScript and React Native for making HTTP requests. It returns a Promise and allows handling GET, POST, PUT, DELETE requests without external dependencies. Unlike axios, fetch is available natively without installing any package.
2What does the fetch() method return when an HTTP request fails with a 404 or 500 code?
What does the fetch() method return when an HTTP request fails with a 404 or 500 code?
Antwort
fetch() always resolves the Promise successfully as long as the network request completes, even for HTTP error codes like 404 or 500. You need to check response.ok or response.status manually to detect HTTP errors. fetch() only rejects the Promise for actual network errors like no connection.
3What is the main advantage of axios over fetch for HTTP requests?
What is the main advantage of axios over fetch for HTTP requests?
Antwort
axios automatically transforms JSON data into JavaScript objects and handles HTTP error codes by rejecting the Promise. With fetch, you need to call response.json() manually and check response.ok. axios also offers interceptors, simplified cancellation, and better default timeout handling.
What is the correct syntax for sending JSON data with fetch in POST?
How does async/await simplify HTTP request handling compared to chained Promises?
+17 Interview-Fragen
Weitere React Native-Interviewthemen
JavaScript Essentials
React Fundamentals
React Native Basics
React Hooks
TypeScript for React & React Native
React Native Components & API
React Native Styling & Layout
React Native Navigation
React Native State Management
Data Persistence
Forms & Validation
React Native Animations
Native Modules & Bridge
Platform-Specific Code
Permissions & Device APIs
Push Notifications
React Native Testing
React Native Debugging
Build & Deployment
Expo vs React Native Bare
Performance Optimization
Memory Management
Architecture Patterns
React Native New Architecture
Security Best Practices
Offline-First Architecture
React Native CI/CD
Monorepo & Code Sharing
Advanced Topics
App Lifecycle & Background Execution
Authentication & Session Management
Monitoring & Crash Reporting
Meistere React Native für dein nächstes Interview
Zugang zu allen Fragen, Flashcards, technischen Tests, Code-Review-Übungen und Interview-Simulatoren.
Kostenlos starten