-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathReactotronConfig.js
45 lines (42 loc) · 1.26 KB
/
ReactotronConfig.js
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
36
37
38
39
40
41
42
43
44
45
/* eslint-disable prefer-destructuring */
import Reactotron, {
trackGlobalErrors,
openInEditor,
networking,
} from 'reactotron-react-native';
import { NativeModules } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { reactotronRedux } from 'reactotron-redux';
let scriptHostname;
if (__DEV__) {
const { scriptURL } = NativeModules.SourceCode;
scriptHostname = scriptURL.split('://')[1].split(':')[0];
}
/* AsyncStorage would either come from `react-native` or `@react-native-async-storage/async-storage`
depending on where you get it from */
const reactotron = Reactotron.setAsyncStorageHandler(AsyncStorage)
// .configure() // controls connection & communication settings
.configure({ host: scriptHostname })
.use(
networking({
ignoreContentTypes: /^(image)\/.*$/i,
ignoreUrls: /\/(logs|symbolicate)$/,
}),
)
.use(trackGlobalErrors())
.use(openInEditor())
.use(reactotronRedux())
.useReactNative() // add all built-in react native plugins
.connect(); // let's connect!
reactotron.useReactNative({
asyncStorage: {
ignore: ['secret'],
},
networking: {
ignoreUrls: /symbolicate/,
},
editor: true,
errors: { veto: () => false },
overlay: true,
});
export default reactotron;