greensock / GSAP

GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
https://gsap.com
19.83k stars 1.72k forks source link

Using plugin #197

Closed mrasoahaingo closed 7 years ago

mrasoahaingo commented 7 years ago

Hi, in my React project, I want to use the ScrollToPlugin I am using Webpack/Babel environment: This is what I try to do, but it doesn't have any effect on my element:

import { TweenLite, ScrollToPlugin } from 'gsap';

...

// this.list is my div element that have an overflow scroll
TweenLite.to(this.list, 1, { scrollTo: +this.list.scrollHeight });

I thought importing ScrollToPlugin will take it into account :(

mrasoahaingo commented 7 years ago

Oh, it works when importing it separatly

import { TweenLite } from 'gsap';
import ScrollToPlugin from 'gsap/ScrollToPlugin';