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

feat: added Reanimated v2 support #15

Merged

Conversation

sa8ab
Copy link
Contributor

@sa8ab sa8ab commented Aug 17, 2020

This makes the library work with reanimated 2

@sa8ab
Copy link
Contributor Author

sa8ab commented Aug 17, 2020

I wonder if it will drop the usage for reanimated1 or not?

@gorhom
Copy link
Owner

gorhom commented Aug 18, 2020

hi @sa8ab ! thanks for submitting this PR, i'll test it now

@gorhom gorhom changed the title Sa8ab reanimated2 feat: added Reanimated v2 support Aug 18, 2020
@gorhom gorhom self-requested a review August 18, 2020 19:44
gorhom
gorhom previously requested changes Aug 18, 2020
Copy link
Owner

@gorhom gorhom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it will drop the usage for reanimated1 or not?

yeah, this broke usage with Reanimated v1. However here are the solution:

in constants.ts, change the import of easing to be

const { Easing: EasingV1, EasingNode: EasingV2 } = require('react-native-reanimated')
const Easing = EasingV2 || EasingV1

in BottomSheet.tsx

const { interpolate: interpolateV1, interpolateNode: interpolateV2 } = require('react-native-reanimated')
const interpolate = interpolateV2 || interpolateV1

@gorhom
Copy link
Owner

gorhom commented Aug 21, 2020

hi @sa8ab , would you be able to update this pr ? i could pick it up :)

@gorhom gorhom changed the base branch from master to feature/reanimated-v2-compatibility August 21, 2020 20:20
@gorhom gorhom dismissed their stale review August 21, 2020 20:21

i will work on it

@gorhom gorhom merged commit ad24278 into gorhom:feature/reanimated-v2-compatibility Aug 21, 2020
gorhom added a commit that referenced this pull request Aug 21, 2020
* feat: added Reanimated v2 support (#15)

* Update Easing to work with reanimated 2

* compatible with reanimated 2

* chore: updated import Easing & interpolate from reanimated

Co-authored-by: sa8ab <59901734+sa8ab@users.noreply.github.com>
@sa8ab
Copy link
Contributor Author

sa8ab commented Aug 22, 2020

Hey @gorhom sorry for my late delay, I'm glad it is in the new version.

@gorhom
Copy link
Owner

gorhom commented Aug 23, 2020

@sa8ab nah , no worries about it, thanks for the contribution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants