i'm using React Native v.43.0-rc.3 and have this error in my Android emulator when i hit my toggle button:
undefined is not an object (evaluating 'action.type')
My toggle button is connected to a function in /action/index.js
:
export const toggleUpdateSwitch = (showUpdates) => {
// error goes away when i remove this line below ----+v
AnalyticsTracker.trackEvent({"category": "profile", "action" : "toggle", "label": "section/updates"})
async dispatch => {
ToastAndroid.show(TOGGLE_UPDATES_NO_DATA_MESSAGE, ToastAndroid.LONG, ToastAndroid.CENTER);
const response = await fetch('http://my.url.com/doSomething', { headers, method: 'GET' });
}
}
So i added the line above (AnalyticsTracker), and that's what causes the error when i toggle. Any ideas?
Emulator error screenshot: