leafo / sticky-kit

A jQuery plugin for creating smart sticky elements

Home Page:http://leafo.net/sticky-kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sticky Kit with React

rallyinteractive opened this issue · comments

I'm trying to use Sticky Kit with react but running into "Window is not defined" error when I run my app. Is there a way to work around this or a fix for this that I have not been able to find? I've tried a few different things but with no luck. Any help with this issue would be greatly appreciated.

You have to add something like this to your webpack config:

{ test: /\.js$/, include: [ path.join(__dirname, 'node_modules', 'sticky-kit') ], loader: 'imports-loader?jQuery=jquery,$=jquery,window=>global&window.jQuery=jquery,this=>window,define=>false' }