Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
diegonunes4 opened this issue Apr 11, 2022 · 4 comments
Open

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

diegonunes4 opened this issue Apr 11, 2022 · 4 comments

Comments

@diegonunes4
Copy link

diegonunes4 commented Apr 11, 2022

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?

@akavato
Copy link

akavato commented Jun 17, 2022

Why you are importing from rc-scrollbars, this repo is about react-custom-scrollbars-2)

@antonio-ivanovski
Copy link

antonio-ivanovski commented Jun 22, 2022

Same issue
image

@smartgru
Copy link

@ToTeTo
I've add below "resolutions" in package.json and it resolved the above issue.

"resolutions": {
    "@types/react": "17.0.40",
    "@types/react-dom": "17.0.13"
  },

@woowalker
Copy link

any ideas without resolutions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants