-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Property 'children' does not exist on type 'IntrinsicAttributes....' #88
Comments
have you solved it? Container and Droggable have a prop called render. Move each component's children to this prop This is a rewritten smooth-dnd-demo. However, now I have errors in the console. |
@SerhiyDemchuk I'm still getting the same error
|
@pmoieni do the same to Draggabe children, the component also has the prop "render" |
@SerhiyDemchuk thanks. Now it's working.
|
@pmoieni do you have any errors in the console? Because despite I have no errors in IDE, I don't see any data to be rendered |
@SerhiyDemchuk I thought when the error is gone everything should work. I have lots of errors in the console and just a blank screen. someone should update the documentation. |
Hi, is there any update on this cause I am having the same issue. |
If someone is still having that problem: I think its only a type issue where the components were not declared in a way that allows them to have child components. We only came across this when we updated typescript at some point. We wrote a patch for it. The Draggable and Container components extend the incorrect type (e.g. in Draggable.d.ts)
rather than
Here is the patch file we used to fix it for us:
Can just run
|
Can confirm that adding |
While suggested patch did work, a patched version will be lifesaver for many of us. |
import Box from "@mui/material/Box"
import { Draggable as SmoothDraggable } from "react-smooth-dnd"
import { type ReactNode } from "react"
import { type SxProps } from "@mui/material"
interface TypeProps {
children: ReactNode
sx?: SxProps
}
const DndDraggable: React.FC<TypeProps> = ({ children, sx }) => {
return <SmoothDraggable render={() => <Box sx={sx}>{children}</Box>} />
}
export default DndDraggable |
I just upgraded my project from react 17 to react 18 and now I'm getting this error.
this is my code:
The text was updated successfully, but these errors were encountered: