Fix reactotron multiple connections (#3622)

This commit is contained in:
Gleidson Daniel Silva 2022-02-09 16:02:14 -03:00 committed by GitHub
parent 5997c7ae6b
commit d874012e61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -1,4 +1,5 @@
/* eslint-disable */
import AsyncStorage from '@react-native-community/async-storage';
import { NativeModules } from 'react-native';
import Reactotron from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux';
@ -7,7 +8,12 @@ import sagaPlugin from 'reactotron-redux-saga';
if (__DEV__) {
const scriptURL = NativeModules.SourceCode.scriptURL;
const scriptHostname = scriptURL.split('://')[1].split(':')[0];
Reactotron.configure({ host: scriptHostname }).useReactNative().use(reactotronRedux()).use(sagaPlugin()).connect();
Reactotron.setAsyncStorageHandler(AsyncStorage)
.configure({ host: scriptHostname })
.useReactNative()
.use(reactotronRedux())
.use(sagaPlugin())
.connect();
// Running on android device
// $ adb reverse tcp:9090 tcp:9090
Reactotron.clear();