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

Rename ref & aref -> animatedRef in types #4469

Merged
merged 1 commit into from
May 18, 2023

Conversation

kacperkapusciak
Copy link
Member

For better DX and consistency with the docs (current and the new ones) I've decided to rename the first argument of useScrollViewOffset, measure, getRelativeCoords, and scrollTo to animatedRef.

Motivation

Just ref as an argument indicates that a plain const ref = React.useRef() works with these functions leading to a confusing developer experience.

Also, aref is a bit cryptic and a hard thing to look up on the Internet when just starting to learn Reanimated.

Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

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

👏

@piaskowyk piaskowyk added this pull request to the merge queue May 18, 2023
Merged via the queue into main with commit 58a4210 May 18, 2023
6 checks passed
@piaskowyk piaskowyk deleted the @kacperkapusciak/rename-animatedRef-arg-in-types branch May 18, 2023 09:49
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
For better DX and consistency with the docs (current and the new ones)
I've decided to rename the first argument of `useScrollViewOffset`,
`measure`, `getRelativeCoords`, and `scrollTo` to `animatedRef`.

### Motivation

Just `ref` as an argument indicates that a plain `const ref =
React.useRef()` works with these functions leading to a confusing
developer experience.

Also, `aref` is a bit cryptic and a hard thing to look up on the
Internet when just starting to learn Reanimated.
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

2 participants