DefinitelyTyped/types/react-smooth-scrollbar/react-smooth-scrollbar-tests.tsx
2017-06-21 09:48:37 +02:00

22 lines
542 B
TypeScript

import * as React from "react";
import * as SmoothScrollbar from "react-smooth-scrollbar";
<SmoothScrollbar className="test" alwaysShowTracks onScroll={(status, instance) => { } } />;
<SmoothScrollbar speed={10} overscrollEffect="bounce" />;
class Test extends React.Component {
ref: SmoothScrollbar | null;
componentDidMount() {
if (this.ref) {
this.ref.scrollbar.scrollTo(0, 500);
}
}
render() {
return (
<SmoothScrollbar ref={ref => this.ref = ref} />
);
}
}