question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I get nested DraggableFlatList to work?

See original GitHub issue

I have an array of objects where each object also contains an array of items.

For example: [ { group1: [{…}] }, { group2: [{…}] }, { group3: [{…}] } ]

I need to be able to sort the groups and also items in the groups. The component works fine when sorting the groups but when I try to drag items, I get this error this._scrollRef.scrollTo is not a function.

My code is something like this:

<DraggableFlatList data={mainArray} renderItem={() => ( {… <DraggableFlatList data={itemArray} … /> } )} />

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
ReemaVinodGangdevcommented, Feb 20, 2020

@wonghupwen Did you get any solution then?

0reactions
ReSenpaicommented, Jul 22, 2022

You can use the scrollEnabled field from your parent DraggableFlatList.

To disable scrolling of parent DraggableFlatList while dragging in child DraggableFlatLis

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create a drag and drop nested list in React Native
Try the following: import React, { useState, useCallback, Component } from 'react'; import { View, TouchableOpacity, Text, SafeAreaView, ...
Read more >
react-native-draggable-flatlist - npm
Nesting DraggableFlatLists. It's possible to render multiple DraggableFlatList components within a single scrollable parent by wrapping one or ...
Read more >
React Native TypeScript | Nested Flatlist Tutorial - YouTube
React Native TypeScript | Nested Flatlist Tutorial | Dope Programming ... TypeScript and your loved tech react native. if you like my work...
Read more >
React Native Draggable FlatList - Morioh
To use swipeable list items in a DraggableFlatList see React Native Swipeable ... for React Native that allows to create a listview with...
Read more >
How to create a drag and drop nested list in React Native ...
... Text, SafeAreaView, ScrollView } from 'react-native'; import DraggableFlatList, { RenderItemParams, } from 'react-native-draggable-flatlist'; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found