-
Hi, (sorry for lot of questions) i try to use ClickScrollPlugin like this: const ref = useRef<OverlayScrollbarsComponentRef<'div'>>(null);
useEffect(() => {
const component = ref.current;
if (!component) {
return;
}
component.osInstance()?.plugin(ClickScrollPlugin);
}, []); But get error in TypeScript:
Also looks like its not working in runtime. I try to use it according to main page https://kingsora.github.io/OverlayScrollbars/ How to use it properly? |
Beta Was this translation helpful? Give feedback.
Answered by
KingSora
Oct 24, 2023
Replies: 1 comment 3 replies
-
@krutoo Plugins are registered globally, so you don't have to add them per instance. In your entry file (where you mount your root react component) you can do: import { OverlayScrollbars, ClickScrollPlugin } from 'overlayscrollbars';
OverlayScrollbars.plugin(ClickScrollPlugin); If you want <OverlayScrollbarsComponent options={{ scrollbars: { clickScroll: true } }}>
</OverlayScrollbarsComponent> |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
krutoo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@krutoo Plugins are registered globally, so you don't have to add them per instance.
In your entry file (where you mount your root react component) you can do:
If you want
clickScroll
to work in your instance, you have to specify the corresponding option to true: