Skip to content

Commit

Permalink
fix perfect scrollbar component
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamona-WD committed Feb 12, 2022
1 parent 15227ac commit cf07b35
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions stubs/react/js/Components/PerfectScrollbar.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import PerfectScrollbar from "perfect-scrollbar";
import { useEffect, useRef } from "react";
import PerfectScrollbar from "perfect-scrollbar";

export default (props) => {
const { tag: Tag = "div" } = props;

const el = useRef(null);
const el = useRef();

let ps = null;

Expand All @@ -15,7 +15,7 @@ export default (props) => {
};

useEffect(() => {
ps = new PerfectScrollbar("#a", props.settings || {});
ps = new PerfectScrollbar(el.current, props.settings || {});

return () => {
ps.destroy();
Expand All @@ -27,7 +27,6 @@ export default (props) => {
className={`relative ${props.className}`}
onMouseOver={update}
ref={el}
id="a"
>
{props.children}
</Tag>
Expand Down

0 comments on commit cf07b35

Please sign in to comment.