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.

[v4] animatedIndex passed to backgroundComponent is always -1

See original GitHub issue

Bug

I’m trying to use the exact example you provide for backgroundComponent and it is not animating. If I do a console.log on animatedIndex.value it always returns -1.

Environment info

Library Version
@gorhom/bottom-sheet 4.0.3
react-native 0.64.1
react-native-reanimated 2.2.0
react-native-gesture-handler 1.10.3

Steps To Reproduce

  1. I copy/pasted the full example from the examples folder into my app and tried it and got the described result above.

Describe what you expected to happen:

  1. It should animate between colors and it is not.

Reproducible sample code

https://snack.expo.dev/@codylundquist/bottomsheet-v4-reproducible-for-647

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
meeniecommented, Sep 23, 2021

Playing around with the snack more and trying the custom backdrop example, it seems to be working. The error I pointed out seems to be an Expo Go issue. Reloading the app when it happens fixes it. I’m still pretty confused how this animation stuff works. It would be great if there was some documentation around explaining it more. Thanks!

0reactions
meeniecommented, Sep 23, 2021

Do you have some documentation around this?

Also, I updated the snack to what you suggested and it crashed the app with an error of “Uncaught Error: Animated node with ID 2 already exists.” I’ve updated the snack so you can see for yourself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[v4] animatedIndex passed to backgroundComponent is ...
I'm trying to use the exact example you provide for backgroundComponent and it is not animating. If I do a console.log on animatedIndex.value...
Read more >
Custom Background | React Native Bottom Sheet
Custom Background. To override the default background, you will need to pass the prop backgroundComponent to the BottomSheet component.
Read more >
[v4] animatedIndex passed to backgroundComponent is always
Bug I'm trying to use the exact example you provide for backgroundComponent and it is not animating.
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