gilbox / react-spark-scroll

Scroll-based actions and animations for react
358 stars 48 forks source link

Large Footprint #33

Closed PatrickDuncan closed 7 years ago

PatrickDuncan commented 7 years ago

Hello I wanted to use your library just for the feature of knowing when the user has scrolled up/down on a div, but by simply using this with 5 divs:

const { SparkScroll } = require('react-spark-scroll-gsap')( { invalidateAutomatically: true } );

My minified webpack bundle went from 218 kb to 396 kb. Its definitely from lodash and gsap.

I saw react-track, but I saw that it also uses lodash and isn't as active.

gilbox commented 7 years ago

Yeah, it probably doesn't make sense to use this project for something that simple.

react-track might work for your use-case. Yes lodash is listed in package.json, but it's not actually used anywhere in the project so it shouldn't be added to your bundle. Not sure what you mean by it not being active. There are several maintainers of react-track and every time there has been an issue/PR we have addressed it. Afaik, no one is working on adding new features if that's what you mean.

PatrickDuncan commented 7 years ago

Thank you for the quick response, I'll look into react-track!