Reactotron: When using reactotron-redux-saga on typescript it requires an argument

Created on 2 Apr 2020  路  2Comments  路  Source: infinitered/reactotron

I was trying to use reactotron as ts file, and I have done this structure:

import Reactotron from 'reactotron-react-js';
import { reactotronRedux } from 'reactotron-redux';
import reactotronSaga from 'reactotron-redux-saga';

if (process.env.NODE_ENV === 'development') {
  const tron = Reactotron.configure()
    .use(reactotronRedux())
    .use(reactotronSaga())
    .connect();

  tron.clear();

  console.tron = tron;
}

But when I try to compile, I get this error on "reactotronSaga":

Expected 1 arguments, but got 0.ts(2554)
index.d.ts(4, 26): An argument for 'pluginConfig' was not provided.

Most helpful comment

@charles00willian to solve this case, I got it like this ...

import Reactotron from 'reactotron-react-js';
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';


declare global {
  interface Console {
    tron: any;
  }
}

interface PluginConfig {
  except?: string[];
}

if (process.env.NODE_ENV === 'development') {
  const tron = Reactotron.configure()
    .use(reactotronRedux())
    .use(sagaPlugin({ except: [''] }))
    .connect();

  tron.clear!();

  console.tron = tron;
}

All 2 comments

@charles00willian to solve this case, I got it like this ...

import Reactotron from 'reactotron-react-js';
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';


declare global {
  interface Console {
    tron: any;
  }
}

interface PluginConfig {
  except?: string[];
}

if (process.env.NODE_ENV === 'development') {
  const tron = Reactotron.configure()
    .use(reactotronRedux())
    .use(sagaPlugin({ except: [''] }))
    .connect();

  tron.clear!();

  console.tron = tron;
}

@charles00willian to solve this case, I got it like this ...

import Reactotron from 'reactotron-react-js';
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';


declare global {
  interface Console {
    tron: any;
  }
}

interface PluginConfig {
  except?: string[];
}

if (process.env.NODE_ENV === 'development') {
  const tron = Reactotron.configure()
    .use(reactotronRedux())
    .use(sagaPlugin({ except: [''] }))
    .connect();

  tron.clear!();

  console.tron = tron;
}

Worked!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skellock picture skellock  路  4Comments

Kida007 picture Kida007  路  4Comments

sylar picture sylar  路  4Comments

Anahkiasen picture Anahkiasen  路  5Comments

tolu360 picture tolu360  路  5Comments