forked from kacgrzes/expo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ReactotronConfig.ts
35 lines (31 loc) · 1.03 KB
/
ReactotronConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import AsyncStorage from '@react-native-async-storage/async-storage'
import { NativeModules } from 'react-native'
import Reactotron from 'reactotron-react-native'
/**
* Note:
* If using an Android device or emulator run the following command to make sure it can connect to Reactotron:
* adb reverse tcp:9090 tcp:9090
* (9090 is the default port for Reactotron)
* See: https://github.com/infinitered/reactotron/blob/master/docs/quick-start-react-native.md#configure-reactotron-with-your-project
*/
let scriptHostname
if (__DEV__) {
const scriptURL = NativeModules.SourceCode.scriptURL
scriptHostname = scriptURL.split('://')[1].split(':')[0]
}
Reactotron?.setAsyncStorageHandler?.(AsyncStorage)
.configure({
name: 'Reactotron In Expo demo',
host: scriptHostname,
})
.useReactNative({
asyncStorage: false,
networking: {
ignoreUrls: /symbolicate|127.0.0.1/,
},
editor: false,
errors: { veto: (stackFrame) => false },
overlay: false,
})
.connect()
console.log = Reactotron.log || console.log