A React Native app for the ultimate thinking partner.
1/**
2 * Polyfills for React Native
3 *
4 * React Native doesn't have native support for:
5 * - TextEncoder/TextDecoder - needed by some libraries
6 * - Base64 encoding - needed for file uploads
7 * - URL parsing - needed for API calls
8 *
9 * This file loads polyfills to add these missing APIs.
10 */
11
12import { Platform } from 'react-native';
13
14// Only apply polyfills on native platforms
15if (Platform.OS !== 'web') {
16 console.log('🔧 Loading polyfills for React Native...');
17
18 // Load basic polyfills (encoding, base64, URL)
19 require('react-native-polyfill-globals/src/encoding');
20 require('react-native-polyfill-globals/src/base64');
21 require('react-native-polyfill-globals/src/url');
22
23 console.log('✅ Basic polyfills loaded (encoding, base64, URL)');
24} else {
25 console.log('🌐 Running on web, no polyfills needed');
26}