reactotron icon indicating copy to clipboard operation
reactotron copied to clipboard

Types networking error (TypeScript)

Open vladyslav-honchenko opened this issue 1 year ago • 6 comments

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

vladyslav-honchenko avatar Jul 19 '24 18:07 vladyslav-honchenko

I am getting this as well. Have you found a workaround?

gfirmill avatar Sep 10 '24 21:09 gfirmill

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')

Qwin avatar Sep 12 '24 18:09 Qwin

Can also use the @ts-ignore annotation.

GSFZamai avatar Dec 30 '24 20:12 GSFZamai

Can also use the @ts-ignore annotation.

OMG, really? No way ....😆

vladyslav-honchenko avatar Dec 30 '24 22:12 vladyslav-honchenko

Can also use the @ts-ignore annotation.

OMG, really? No way ....😆

Yah, really 😀

GSFZamai avatar Jan 01 '25 14:01 GSFZamai

Was this ever fixed or are we all just @ts-ignoreing this still. I am still seeing this error on 5.1.12.

jrymer avatar Jan 22 '25 23:01 jrymer