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.

Updating sheet position after snapPoints change

See original GitHub issue

It doesn’t appear that the position of the sheet changes if the snapPoints props are changed. Is there any way to make this work? Or is that not supported?

It would be nice to have the positions be dynamic based on content heights, where the snapPoints are defined from state values set in onLayout callbacks of the sheet elements.

Issue Analytics

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

github_iconTop GitHub Comments

12reactions
njdancercommented, Aug 26, 2019

As a workaround you can set the key to a value changes with the snapPoints. This will force a re-render.

For example:

const BottomSheetContainer = ({ snapPointHeight }) => {
  return (
    <BottomSheet
      key={snapPointHeight}
      renderContent={() => <BottomSheetContent />}
      renderHeader={() => <BottomSheetHeader />}
      snapPoints={[snapPointHeight, 400]}
    />
  )
}

5reactions
EricPKerrcommented, Oct 31, 2019

@osdnk is there a recommended way to do this? Seems like dynamic snapPoint support would be an awesome addition to this

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use animatedPosition prop in react-native-bottom-sheet
animatedPosition return shared-values of Reanimated which can be used to animate/interpolate other views in the screen.
Read more >
CSS Scroll Snap Points Module Level 1 - W3C
This module contains features to control panning and scrolling behavior with "snap positions". CSS is a language for describing the rendering of ...
Read more >
CSS Scroll Snap Points - CSS: Cascading Style Sheets | MDN
These determine the specific positions that a container's scrollport may end at after a scrolling operation has completed.
Read more >
Tentative Snap Points - Bentley - Product Documentation
A tentative snap point is a form of graphic input that is used to: Preview the location of the next data point. Accepting...
Read more >
react-spring-bottom-sheet - npm package - Snyk
Learn more about react-spring-bottom-sheet: package health score, ... content have changed its height in such a way that the valid snap points have...
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