Coder Social home page Coder Social logo

Comments (8)

m1kys avatar m1kys commented on July 28, 2024 1

I can repro this issue by @Eyesonly88 comment.

I can fix this by next code:

<React.Fragment> <View style={{flex: 1}}> ...screen content here </View> <BottomSheet ...content for BottomSheet /> </React.Fragment>

It's seem that BottomSheet do not support View wrap (@satya164).

from react-native-reanimated-bottom-sheet.

Eyesonly88 avatar Eyesonly88 commented on July 28, 2024

Update: managed to get it to render in RN 59.

The issue was I had a <View> wrapping the <BottomSheet>. This used to work in previous versions but now does not work.

So the workaround:
The <BottomSheet> should not be wrapped and don't set 'position: absolute' on its container.

Conclusion:

Not sure if having a wrapper is supported.
IMO it should work like before. So potentially this is a regression (bug).

But yeah up to you @osdnk 👍

from react-native-reanimated-bottom-sheet.

nosalvage avatar nosalvage commented on July 28, 2024

i have the same bug, wrapped only in main screen view (flex 1). iOS works fine. Android doesn't render anything. No position absolute used. Please help!

react: ^16.6.3 => 16.8.4
react-native: ^0.58.6 => 0.58.6

from react-native-reanimated-bottom-sheet.

satya164 avatar satya164 commented on July 28, 2024

Does anyone have a repro somewhere I can check?

from react-native-reanimated-bottom-sheet.

Eyesonly88 avatar Eyesonly88 commented on July 28, 2024

@satya164 if expo supported 59.5 I would have given a repro link ;)

Make a new repo and do:

<View style={{flex: 1}}>
<BottomSheet
          snapPoints={[
            100,
            200,
          ]}
          initialSnap={1}
          renderContent={() =>
            <View><Text>Hello Header!</Text></View>
          }
          renderHeader={() => <View><Text>Hello Content!</Text></View>}
        />
</View>

This would break and if you add position: absolute it will break both iOS & Android.

from react-native-reanimated-bottom-sheet.

satya164 avatar satya164 commented on July 28, 2024

I inited a new project with react-native init and tried the code you provided. Seems to be working fine.

from react-native-reanimated-bottom-sheet.

brian-ws avatar brian-ws commented on July 28, 2024

Why don't we post this solution to the README file? It could save many hours for others. Especially the example in README has inside

from react-native-reanimated-bottom-sheet.

dac09 avatar dac09 commented on July 28, 2024

Hi, just wanted to drop a line here for anyone experiencing invisible elements when using DraggableFlatlist inside the bottom sheet. The solution is simple (after a while of trying!) - to wrap the DraggableFlatlist with a view, and give it 100% height.

// Component part of renderContent for bottom sheet
    <View style={{height: '100%'}}>
      <DraggableFlatList
        keyExtractor={item => `${item.id}-draggable`}
        data={places}
        renderItem={({ item, drag }) => (
          <MyCustomComponent
            key={item.id}
            drag={drag}
            place={item}
          />
        )}
      />
    </View>

from react-native-reanimated-bottom-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.