Types networking error (TypeScript)
Describe the bug
We have an incorrect type in networking method:
import Reactotron, { networking } from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux';
const reactotron = Reactotron.configure({ name: 'My App' })
.useReactNative()
.use(reactotronRedux())
.use(networking()) <-------here
.connect();
export default reactotron;
Error
Argument of type '(reactotron: ReactotronCore) => { onConnect: () => void; }' is not assignable to parameter of type 'PluginCreator<ReactotronReactNative & { createEnhancer: (skipSettingStore?: boolean | undefined) => (createStore: any) => (reducer: any, ...args: any[]) => any; setReduxStore: (store: any) => void; reportReduxAction: (action: { ...; }, ms: number, important?: boolean | undefined) => void; }>'. Types of parameters 'reactotron' and 'client' are incompatible. Type 'ReactotronReactNative & { createEnhancer: (skipSettingStore?: boolean | undefined) => (createStore: any) => (reducer: any, ...args: any[]) => any; setReduxStore: (store: any) => void; reportReduxAction: (action: { ...; }, ms: number, important?: boolean | undefined) => void; }' is not assignable to type 'ReactotronCore'. Types of property 'options' are incompatible. Type 'ClientOptions<ReactotronReactNative & { createEnhancer: (skipSettingStore?: boolean | undefined) => (createStore: any) => (reducer: any, ...args: any[]) => any; setReduxStore: (store: any) => void; reportReduxAction: (action: { ...; }, ms: number, important?: boolean | undefined) => void; }>' is not assignable to type 'ClientOptions<ReactotronCore>'.Type 'ReactotronCore' is not assignable to type 'ReactotronReactNative & { createEnhancer: (skipSettingStore?: boolean | undefined) => (createStore: any) => (reducer: any, ...args: any[]) => any; setReduxStore: (store: any) => void; reportReduxAction: (action: { ...; }, ms: number, important?: boolean | undefined) => void; }'. Type 'ReactotronCore' is missing the following properties from type 'ReactotronReactNative': useReactNative, setAsyncStorageHandler, log, logImportant, and 15 more.ts(2345)
Reactotron version
5.1.7
I am getting this as well. Have you found a workaround?
same issue with these 3 plugins: .use(asyncStorage()) .use(networking()) .use(trackGlobalErrors())
used for now this to not type check them:
const { networking, asyncStorage, trackGlobalErrors } = require('reactotron-react-native')
Can also use the @ts-ignore annotation.
Can also use the
@ts-ignoreannotation.
OMG, really? No way ....😆
Can also use the
@ts-ignoreannotation.OMG, really? No way ....😆
Yah, really 😀
Was this ever fixed or are we all just @ts-ignoreing this still. I am still seeing this error on 5.1.12.