react-custom-scrollbars-2
react-custom-scrollbars-2 copied to clipboard
[BUG] 'Scrollbars' cannot be used as a JSX component.
Hello I'm creating a component that uses the Scrollbars and adds the style, this is used after like the normal component is, it's only a way to not repeat code.
This is the code:
import React from 'react';
import { Scrollbars } from 'rc-scrollbars';
const renderThumb = ({ style, ...props }: { style: any }) => {
const thumbStyle = {
borderRadius: 6,
backgroundColor: 'gray',
};
return <div style={{ ...style, ...thumbStyle }} {...props} />;
};
function CustomScrollbar(props: any) {
return <Scrollbars /* renderThumbHorizontal={renderThumb} */ renderThumbVertical={renderThumb} children={false} {...props} />;
}
export default CustomScrollbar;
Any idea?