Skip to content

Conversation

@nicolascavallin
Copy link

Motivation

The motivation for making this change is to fix THIS fix when you update to the latest version of react-native-reanimated

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@exzos28
Copy link

exzos28 commented Sep 7, 2023

still need

@nicolascavallin
Copy link
Author

@gorhom is there any chance to check it or consider it for an update?

@gorhom gorhom added v4 Written in Reanimated v2 v5 labels Sep 10, 2023
@gorhom gorhom self-assigned this Sep 10, 2023
@gorhom gorhom merged commit 0b1c8cc into gorhom:master Sep 10, 2023
@gorhom
Copy link
Owner

gorhom commented Sep 10, 2023

thanks @nicolascavallin for submitting this PR <3

@andrei-lt
Copy link

andrei-lt commented Nov 3, 2023

Thanks for the PR @nicolascavallin.

I still found some typecheck issues when directly using animatedSnapPoints from the result of useBottomSheetDynamicSnapPoints as a value for snapPoints.

I think it's because when react-native-bottom-sheet is built, it still uses reanimated v2 as a dependency.
When it generates the typescript declaration files, it generates something like this:

export declare const useBottomSheetDynamicSnapPoints: (initialSnapPoints: Array<string | number>) => {
    animatedSnapPoints: Readonly<{
        value: (string | number)[];
    }>;
...

A SharedValue object gets replaced with just { value: ... } as a definition and it doesn't match what the new SharedValue in reanimated v3 is defined as. The change happened in reanimated #3722.

TLDR is snapPoints prop expects a full shared value object, but useBottomSheetDynamicSnapPoints declared that it returns a partial object only.

Have I missed something somewhere and this is actually just fine for others?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 Written in Reanimated v2 v5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v4] | [v2] TS Type error with useBottomSheetDynamicSnapPoints

4 participants