reactotron
reactotron copied to clipboard
When using reactotron-redux-saga on typescript it requires an argument
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.
@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!