react-custom-scrollbars-2 icon indicating copy to clipboard operation
react-custom-scrollbars-2 copied to clipboard

[BUG] 'Scrollbars' cannot be used as a JSX component.

Open diegonunes4 opened this issue 2 years ago • 4 comments

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?

diegonunes4 avatar Apr 11 '22 10:04 diegonunes4