1

I'm trying to create a drop down component and I need opening drop down done with animation of it's height. I used reanimated 2 library for my project and I'm wondering why it is not working:

    const dropDownOptionsHeight = useSharedValue(0);

    const animatedStyles = useAnimatedStyle(() => {
        console.log(dropDownOptionsHeight.value);
        return {height: dropDownOptionsHeight.value + 120};
    });

//this is my drop down box container:
const dropDownOptionsContainer = useCallback(() => {
        return (
            <Box
                style={[styles.dropDownOptionsContainer, animatedStyles]}
            >
                <Text variant='regular'>hello</Text>
            </Box>
        );
    }, [animatedStyles, styles.dropDownOptionsContainer]);

0 Answers0