1import { Platform } from 'react-native'; 2 3import HMRClient from './HMRClient'; 4 5// Sets up developer tools for React Native web. 6if (!Platform.isTesting) { 7 // We assume full control over the console and send JavaScript logs to Metro. 8 // [ 9 // 'trace', 10 // 'info', 11 // 'warn', 12 // 'error', 13 // 'log', 14 // 'group', 15 // 'groupCollapsed', 16 // 'groupEnd', 17 // 'debug', 18 // ].forEach(level => { 19 // const originalFunction = console[level]; 20 // console[level] = function (...args: readonly any[]) { 21 // HMRClient.log( 22 // // @ts-expect-error 23 // level, args); 24 // originalFunction.apply(console, args); 25 // }; 26 // }); 27 28 HMRClient.log('log', [`[${Platform.OS}] Logs will appear in the browser console`]); 29} 30 31// This is called native on native platforms 32HMRClient.setup({ isEnabled: true }); 33