BottomSheet should allow users to decide their ScrollView Component instead of a hardcoded ScrollView

Open
#3,756 0 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
react-native, typescript
Domain
mobile

Research direction

Start at packages/base/src/BottomSheet/BottomSheet.tsx#L73, where the BottomSheet currently places a ScrollView around its children. Review the component's existing props and how React Native FlatList and ScrollView interact. Done means users can choose the scroll container or ScrollViewComponent so a FlatList can be used without the nested VirtualizedLists warning.

Written by the indexing model from the issue text.

Description

Needs Triage

Is your feature request related to a problem? Please Describe.

I would like to using FlatList inside RNE BottomSheet (I have to display a long list in that BottomSheet), but I get this error after putting the FlatList inside BottomSheet:

ERROR VirtualizedLists should never be nested inside plain ScrollViews with the same orientation because it can break windowing and other functionality - use another VirtualizedList-backed container instead.

this error is not fatal but may cause issues if user trying to have a complex FlatList

Describe the solution you'd like

The error occurs as BottomSheet already has a ScrollView on top of children in BottomSheet.tsx#L73

Since FlatList is a kind of ScrollView and RN doesn't prefer a ScrollView wrapped inside another ScrollView, we will get the error message above.

Either allow users to define their ScrollView inside children or their ScrollViewComponent in that line will solve the problem

Describe alternatives you've considered

Additional context
I am using RNE 4.0.0-rc7

Dominant language
MDX
Stars
25.9k
Forks
4.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-native-elements/react-native-elements

All issues in react-native-elements/react-native-elements

Similar issues

More Mobile Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.