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

Props animatedIndex and animatedPosition causing infinite updates #149

Closed
tankers746 opened this issue Jan 5, 2021 · 2 comments
Closed
Labels
bug Something isn't working v3 Written in Reanimated v2

Comments

@tankers746
Copy link
Contributor

tankers746 commented Jan 5, 2021

Bug

The animated reactions that update the animated props are causing worklets to loop infinitely.

Environment info

Library Version
@gorhom/bottom-sheet 3.0.2-alpha.1
react-native 0.63.4
react-native-reanimated 2.0.0-rc.0
react-native-gesture-handler 1.9.0

Steps To Reproduce

  1. Run the sample
  2. Move the drawer
  3. Check the console

Reproducible sample code

import { AppRegistry } from 'react-native';
import BottomSheet from '@gorhom/bottom-sheet';

const App = function App() {
    const animatedIndex = useSharedValue(0);

    useDerivedValue(() => {
        console.log(animatedIndex.value);
    });
    return (
        <BottomSheet
            index={0}
            snapPoints={[100, 500]}
            animatedIndex={animatedIndex}>
            <View style={{ backgroundColor: 'red', flex: 1 }} />
        </BottomSheet>
    );
};

AppRegistry.registerComponent('App', () => App);

@tankers746 tankers746 added the bug Something isn't working label Jan 5, 2021
@tankers746
Copy link
Contributor Author

#150

@gorhom gorhom added the v3 Written in Reanimated v2 label Jan 5, 2021
@gorhom
Copy link
Owner

gorhom commented Jan 5, 2021

thanks @tankers746 for submitting this issue and the pr ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 Written in Reanimated v2
Projects
None yet
Development

No branches or pull requests

2 participants