2022-08-19 19:53:40 +00:00
|
|
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
|
|
import { NativeModules, LogBox } from 'react-native';
|
2018-03-23 16:55:40 +00:00
|
|
|
import Reactotron from 'reactotron-react-native';
|
2018-01-12 20:08:31 +00:00
|
|
|
import { reactotronRedux } from 'reactotron-redux';
|
2021-09-13 20:41:05 +00:00
|
|
|
import sagaPlugin from 'reactotron-redux-saga';
|
2018-01-12 20:08:31 +00:00
|
|
|
|
2018-03-23 16:55:40 +00:00
|
|
|
if (__DEV__) {
|
2022-08-19 19:53:40 +00:00
|
|
|
const { scriptURL } = NativeModules.SourceCode;
|
2021-09-13 20:41:05 +00:00
|
|
|
const scriptHostname = scriptURL.split('://')[1].split(':')[0];
|
2022-08-19 19:53:40 +00:00
|
|
|
Reactotron.setAsyncStorageHandler?.(AsyncStorage)
|
2022-02-09 19:02:14 +00:00
|
|
|
.configure({ host: scriptHostname })
|
|
|
|
.useReactNative()
|
|
|
|
.use(reactotronRedux())
|
2022-08-19 19:53:40 +00:00
|
|
|
.use(sagaPlugin({}))
|
2022-02-09 19:02:14 +00:00
|
|
|
.connect();
|
2021-09-13 20:41:05 +00:00
|
|
|
// Running on android device
|
|
|
|
// $ adb reverse tcp:9090 tcp:9090
|
2022-08-19 19:53:40 +00:00
|
|
|
Reactotron.clear?.();
|
|
|
|
// @ts-ignore
|
2021-09-13 20:41:05 +00:00
|
|
|
console.warn = Reactotron.log;
|
2022-08-19 19:53:40 +00:00
|
|
|
// @ts-ignore
|
2021-09-13 20:41:05 +00:00
|
|
|
console.log = Reactotron.log;
|
2022-08-19 19:53:40 +00:00
|
|
|
LogBox.ignoreAllLogs(true);
|
2018-03-23 16:55:40 +00:00
|
|
|
}
|