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

Fix typescript type errors about containers and remove unnecessary pa… #922

Closed
wants to merge 1 commit into from

Conversation

siosio34
Copy link

fix typescript error.

Links to related issues are below.
#864

@petyosi
Copy link
Owner

petyosi commented Jun 12, 2023

I believe that this change basically leaves the ref as unknown. It certainly fixes the problem with styled components, but it breaks the regular component construction. Check this error after removing the ref and using the following code:

const List: GridComponents['List'] = React.forwardRef(({ children, ...props }, ref) => {
  return <div {...props} ref={ref}>{children}</div>
}
image

@petyosi
Copy link
Owner

petyosi commented Jun 12, 2023

The problem (I think) is that react virtuoso uses ComponentPropsWithRef, while the styled components use HTMLProps. Based on this document, I think react-virtuoso does the right thing.

@petyosi petyosi closed this Jul 21, 2023
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

Successfully merging this pull request may close these issues.

2 participants