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.

snapTo method only works good if called two times

See original GitHub issue

Hey! I’m currently having some issues with snapTo method.

If I call it to present the bottom sheet like this

// Present bottom sheet on button press
const onButtonPress = () => {
    bottomSheetRef.current.snapTo(1)
}

// Hide bottom sheet on inner button press
const onInnerButtonPress = () => {
    bottomSheetRef.current.snapTo(0)
}

// sheet setup
<View>
    <Button onPress={onButtonPress} />
    <BottomSheet
        snapPoints = {[0, 250]}
        renderContent = {this.renderContent} // inner button lies here
    />
</View>

So this works only if I press both buttons twice or call snapTo twice in each function…

However snapTo works when i hide the sheet with gesture.

Looks like you can’t use method multiple times in a row without gesture interaction. By the way, waiting time between presses doesn’t change anything

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
osdnkcommented, Apr 26, 2020

should be fixed on master

0reactions
Arykcommented, Apr 30, 2020

You also I think resolved another issue where “hide” was also opening other bottom sheets. 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

reanimated-bottom-sheet snapTo function works at second ...
I'm using this code to avoid issues with snapTo(0). Method to close: closeBottomSheet = () => { if (this.bottomSheetRef && this.
Read more >
Snap! Cheat Sheet - The Beauty and Joy of Computing
Snap! Cheat Sheet. This guide will show you how to match up the procedures in the AP exam language with the blocks in...
Read more >
Pipeline Execute - SnapLogic Documentation - Confluence
The Pipeline Execute Snap is capable of propagating schema in both directions: upstream as well as downstream. See the example Schema ...
Read more >
How to add Snap to alignment feature in FlatList in React ...
It is the best option if you have a large list to render. ... called GeeksforGeeks which we will render multiple times in...
Read more >
Electronic Benefit Transfer (EBT) How to Use Your ...
Remember, you can only buy allowable food items with your SNAP benefits. • All SNAP benefit transactions are free. There is no limit...
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