-
Notifications
You must be signed in to change notification settings - Fork 96
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
can't perform drag and drop with function components #40
Comments
+1 |
+1 any update on this? |
Did you long press the item? |
I'm having a similar issue: Unable to drag certain items. Will post here again as I learn more. I did try with a component generated from |
Managed to find a workaround for my own use-case. Class vs. functional components is not what made it break in my case. Didn't work const renderItem = (item) => {
return <CompositeComponent {...item} />
}
const CompositeComponent = () => <View><SubComponent>...</SubComponent></View> Works const renderItem = (item) => {
return <View><SubComponent>...</SubComponent></View>;
} In short: When I copy-pasted my component into the |
Encountering the same issue. @bjornlll's solution seems to be valid, but it's untenable in practice. |
properly declare the useState
properly declare the render_item
properly use the useState
|
add this prop
if you have any TouchableOpacity component in your renderItem |
In addition to @bjornlll's workaround, I found out wrapping my single component in a didn't work const renderItem = (item) => {
return <CompositeComponent {...item} />
} worked const renderItem = (item) => {
return <View><CompositeComponent {...item} /> </View>
} I'm pretty much showing the same code as @bjornlll, the difference is I didn't copy paste my component in |
when I use the function component instead of the component classes I can't perform the drap and drop or any other event, the components are displayed but no action is possible.
The text was updated successfully, but these errors were encountered: