neciu/react-mixpanel

How to use mixpanel outside of React Components

Closed this issue · 2 comments

This isn't an issue so much as a question; if I want to use mixpanel outside of a React Component (say, in a redux action), would I simply do import mixpanel from 'mixpanel-browser' and use it as normal?

Actually answered my own question. It seems like this is the case!

I've had problems doing this though, if you're doing the server-side render, mixpanel-browser looks for a document, which won't be defined and you're in trouble.

mixpanel/mixpanel-js#119