Skip to content
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

[v4] | [v2] BottomSheetFlatList not rendering items on screen #1760

Closed
fofa-rgb opened this issue Feb 29, 2024 · 7 comments
Closed

[v4] | [v2] BottomSheetFlatList not rendering items on screen #1760

fofa-rgb opened this issue Feb 29, 2024 · 7 comments
Labels
bug Something isn't working no-issue-activity

Comments

@fofa-rgb
Copy link

fofa-rgb commented Feb 29, 2024

Bug

<I'm using gorhoms BottomSheetFlatlist inside of my BottomSheetModal, but it seems like its not rendering anything (but works fine when i use a normal FlatList from the 'react-native-gesture-handler'. I installed the lib using:
npx expo install react-native-reanimated react-native-gesture-handler and npx expo install @gorhom/bottom-sheet@^4>

Environment info

Library Version
@gorhom/bottom-sheet "4"
react-native "0.73.2"
react-native-reanimated "~3.6.2"
react-native-gesture-handler "~2.14.0"

Steps To Reproduce

`import { View, Text, } from 'react-native';
import {BottomSheetFlatList, BottomSheetModal} from '@gorhom/bottom-sheet'
import { forwardRef, useMemo, useRef } from 'react';
import { FlatList } from 'react-native-gesture-handler';

const CustomModal = ()=> {

const snapPoints= useMemo(()=>['90%'], [])
const data= ["one","two","three"]
const ref= useRef(null);
return (
    <BottomSheetModal ref={ref} snapPoints={snapPoints} index={0}  backgroundStyle={{borderRadius:0, backgroundColor:'white'}}>
                <View style={{padding:100}}>
                <BottomSheetFlatList
                    data={data}
                    renderItem={({ item }) => {
                        return (<Text style={{fontSize: 20}}>{item}</Text>)
                        }}
                    />
                </View>
    </BottomSheetModal>
);

};

export default CustomModal;`

1.use a BottomSheetModal
2.use a BottomSheetFlatList inside of it
3. use whatever data you want

Describe what you expected to happen:

1.I expect that i see items provided to the FlatList to be rendered on the screen on both android and Iphone.

Reproducible sample code

<

Bottom Sheet issue snack template https://snack.expo.dev/qmNwoUtzbXf1RzpTLr8QC

@fofa-rgb fofa-rgb added the bug Something isn't working label Feb 29, 2024
@fofa-rgb fofa-rgb changed the title [v4] | [v2] Issue title [v4] | [v2] BottomSheetFlatList not rendering items on screen Feb 29, 2024
@Abhishek2250
Copy link

I'm also facing the same issue. Any update?

Thanks :)

@ZakirBangash
Copy link

same issue

@keshavvgts
Copy link

Same but its working with regular FlatList

@k3sha7
Copy link

k3sha7 commented Mar 27, 2024

I guess it is a simple fix if you are using a view inside the BottomSheetModal try adding flex: 1 to it.

@esorinas
Copy link

esorinas commented Apr 6, 2024

Same issue here and @k3sha7's solution worked for me. Thanks mate!

Copy link

github-actions bot commented May 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Copy link

This issue was closed because it has been stalled for 5 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

6 participants