mikepb / react-draggable

React draggable component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bump version for npm update

autarc opened this issue · comments

The current version at npm points to 0.4.1 which is still missing the window check you recently added with the last commit (see 936629b). Since this fix the conflict which prevents server side rendering, it would be great if you could update the package.

Sure, but there are other references to window in in the file without the check. Would it be better to wrap the entire thing in a function like this?

(function (window) {
   // ...
})(typeof window !== 'undefined' ? window : this);

As the addEvent calls for attaching the handlers are just invoke by mounting the component, they won't be parsed on the server. Nevertheless I guess its reasonable to define a wrapper/proxy for the entire script.

I've pushed changes to npm to prevent errors when accessing browser globals outside of a browser. See
fef33d9

Thanks, works fine.