-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
TableCell component prop cannot be "div" with new typescript version #23717
Comments
@pusztaienike Do you think you could reproduce on Codesandbox? It seems correct in https://codesandbox.io/s/basictable-material-demo-forked-onyfu?file=/demo.tsx. |
I have tried to reproduce it on codesandbox without success. It is a strange behaviour in our monorepo. Please give us some days to find out what the problem is before you close this issue. Thank you! |
Thank you for your patience @oliviertassinari. The problem was a version-mismatch in our repository caused by yarn (yarnpkg/yarn#3967). After updating to @types/react 17.x the errors are gone. |
@pusztaienike I'm glad it's working with React 17 |
@pusztaienike I ran into this same error today when using running a fresh @oliviertassinari I'm curious what would cause this
And when using
Does the From my package:
Is there a way to confirm the correct dependency is installed moving forward? |
With the new typescript version (4.1.2) I got error for add a component="div" prop to a TableCell item.
ERROR in src/components/content-list/display-name-field.tsx:19:7
TS2322: Type '"div"' is not assignable to type '"td" | "th" | ComponentClass<TableCellBaseProps, any> | FunctionComponent | undefined'.
Current Behavior 😯
Typescript throws error to component="div" prop in TableCell
Expected Behavior 🤔
No errors
Steps to Reproduce 🕹
Clone this repository to reproduce: (this is a monorepo)
https://github.com/SenseNet/sn-client
We have so many components where we faced this issue, but here is one example from them:
https://github.com/SenseNet/sn-client/blob/develop/apps/sensenet/src/components/content-list/display-name-field.tsx
We had a workaround for this:
<TableCell component={'div' as any} .... > ... </TableCell>
Try to change it to
<TableCell component="div".... > ... </TableCell>
The following error will occure:
Your Environment 🌎
Tsconfig:
The text was updated successfully, but these errors were encountered: