neciu / react-mixpanel

Unofficial React bindings for Mixpanel
73 stars 19 forks source link

How to use mixpanel outside of React Components #1

Closed rubencodes closed 8 years ago

rubencodes commented 8 years ago

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?

rubencodes commented 8 years ago

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

dphrag commented 7 years ago

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.

https://github.com/mixpanel/mixpanel-js/issues/119