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

Added new useScrollViewOffset hook #3438

Merged
merged 15 commits into from
Sep 2, 2022
Merged

Conversation

Kwasow
Copy link
Contributor

@Kwasow Kwasow commented Aug 3, 2022

Description

This new hook makes it easy to create animations based on the offset of a ScrollView.

Interface:

export function useScrollViewOffset(
  aref: RefObject<Animated.ScrollView>
): SharedValue<number>

Checklist

  • Included code example that can be used to test this change
  • Updated TS types
  • Added TS types tests
  • Added unit / integration tests
  • Updated documentation
  • Ensured that CI passes

@Kwasow Kwasow marked this pull request as ready for review August 3, 2022 13:18
@Kwasow Kwasow marked this pull request as draft August 5, 2022 08:26
@Kwasow Kwasow force-pushed the @kwasow/useScrollViewPosition branch from eb7ce3e to 7721b97 Compare August 29, 2022 05:57
@Kwasow Kwasow marked this pull request as ready for review August 29, 2022 06:10
react-native-reanimated.d.ts Outdated Show resolved Hide resolved
@piaskowyk piaskowyk self-assigned this Sep 1, 2022
@piaskowyk piaskowyk merged commit d481d24 into main Sep 2, 2022
@piaskowyk piaskowyk deleted the @kwasow/useScrollViewPosition branch September 2, 2022 09:08
},
});

const loremImpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet ultrices nisl. Sed aliquam vel justo ut maximus. Ut lacinia odio id metus pulvinar, sed imperdiet risus tincidunt. Pellentesque dapibus rutrum metus nec consequat. Nunc ligula turpis, aliquet quis feugiat eu, aliquet ut metus. Maecenas et pellentesque massa, tempor bibendum eros. Duis tempus, mi nec consectetur tempor, mauris nibh volutpat turpis, eu dictum nunc ipsum et lectus. Duis dictum, urna eget imperdiet ullamcorper, urna orci posuere magna, vel consectetur ipsum urna id urna. Vestibulum mollis ex rutrum pulvinar mollis. Morbi vitae dictum velit. Mauris congue nibh at egestas aliquam. Morbi et odio at ligula ullamcorper pellentesque.
Copy link
Member

Choose a reason for hiding this comment

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

loremIpsum

Copy link
Member

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

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

👍

piaskowyk pushed a commit that referenced this pull request Oct 5, 2022
This new hook makes it easy to create animations based on the offset of a ScrollView.

Interface:
```js
export function useScrollViewOffset(
  aref: RefObject<Animated.ScrollView>
): SharedValue<number>
```

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [x] Updated documentation
- [x] Ensured that CI passes
tomekzaw added a commit that referenced this pull request Jan 20, 2023
## Summary

This PR applies code review suggestions from #3438.

## Test plan

Build Example app and check if Article progress example works.
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Description

This new hook makes it easy to create animations based on the offset of a ScrollView.

Interface:
```js
export function useScrollViewOffset(
  aref: RefObject<Animated.ScrollView>
): SharedValue<number>
```

## Checklist

- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [x] Updated documentation
- [x] Ensured that CI passes
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Summary

This PR applies code review suggestions from software-mansion#3438.

## Test plan

Build Example app and check if Article progress example works.
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.

None yet

3 participants