flipper-plugin-reactotron icon indicating copy to clipboard operation
flipper-plugin-reactotron copied to clipboard

ReactotronFlipper not working with Reactotron

Open orhangazi opened this issue 2 years ago • 0 comments

I want to work with Flipper (flipper-plugin-reactotron). When I import ReactotronFlipper and add createSocket: (path) => new ReactotronFlipper(path), line in the configure, I am getting an error: "The native module for Flipper seems unavailable. Please verify that react-native-flipper is installed....". I tried to install react-native-flipper but not work.

How can I do that?

Related packages and versions: "react-native-flipper": "^0.173.0", "reactotron-react-native": "~5.0.1", "react-native": "0.69.6", "react": "18.0.0",

ReactotronConfig.js:

import Reactotron, { openInEditor } from 'reactotron-react-native'
import { reactotronRedux } from 'reactotron-redux'
import { NativeModules } from 'react-native'
import AsyncStorage from '@react-native-async-storage/async-storage'
import url from 'url'
import ReactotronFlipper from 'reactotron-react-native/dist/flipper'

const reactotron = ( port= 9999, monkeyPatchConsoleLog=true) => {
	const {hostname} = url.parse(NativeModules.SourceCode.scriptURL)
	const portNumber = 9090
	console.log("Host name: "+hostname) // mine was 192.168.1.2

	Reactotron.configure({
			name: "Ulak",
			createSocket: (path) => new ReactotronFlipper(path),
			host: hostname,
			port: Number(portNumber),
			//createSocket: path => new ReactotronFlipper(path),
		})
		.setAsyncStorageHandler(AsyncStorage)
		.useReactNative({
			networking: {
				ignoreUrls: /\/symbolicate|\/logs|127.0.0.1|\/open-stack-frame/,
			},
			errors: true,
			editor: {url: "http://192.168.1.36:19000"}
		})
		.use(reactotronRedux())
		.use(openInEditor())
		.connect()
		.clear()
...

Error screenshot: image

orhangazi avatar Nov 01 '22 16:11 orhangazi