reactotron icon indicating copy to clipboard operation
reactotron copied to clipboard

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

Open charleswvs opened this issue 4 years ago • 2 comments

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.

charleswvs avatar Apr 02 '20 15:04 charleswvs

@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;
}

rafaelsos avatar Apr 09 '20 01:04 rafaelsos

@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!

charleswvs avatar Apr 09 '20 19:04 charleswvs