-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[docs] Gesture hooks #3868
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
[docs] Gesture hooks #3868
Conversation
|
CI fails because of broken links, I'll fix them, but you can still share your thoughts about the structure/content. |
| ### Callbacks common to all continuous gestures: | ||
|
|
||
| ### onUpdate | ||
|
|
||
| { | ||
| <CodeBlock className="language-ts"> | ||
| {`onUpdate: (event: ${props.gesture}HandlerData) => void`} | ||
| </CodeBlock> | ||
| } | ||
|
|
||
| Set the callback that is being called every time the gesture receives an update while it's active. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it matters (to the end user) that onUpdate is on all continuous gestures. Can this be moved to the single callbacks file, which will get isContinuous as a prop and render this when true? Or maybe just removing the secondary headers would be enough?
Currently the sidebar is a bit weird due to the secondary headers:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed secondary headers in 6d2da5a
| @@ -1,5 +1,9 @@ | |||
| ### Properties common to all continuous gestures: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,19 +1,48 @@ | |||
| ### Properties common to all gestures: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same-ish as above. Single file won't work here for sure, but removing the secondary headers would clean it up I think.
We could also go for the consistent ordering:
- Gesture-specific fields
- Continous fields
- Common fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the order seems to be consistent but ok, we can move continuous field above. f90b378
| ### enabled | ||
|
|
||
| ```ts | ||
| enabled: boolean | SharedValue<boolean>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can SharedValue link to Reanimated docs about shared value, or is the technology not here yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean SharedValue inside
```ts
then I'm afraid that technology is not here yet 😞
... but we can add a reference to it below (though it might be too redundant to do).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you think about 41f7a4f (cc. @akwasniewski)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not ideal, but since we can't add it in ```ts``` it is the best we can do.
| ### hitSlop | ||
|
|
||
| ```ts | ||
| hitSlop: HitSlop | SharedValue<HitSlop>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work with SharedValue like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's something that I've mentioned in the docs thread in roadmap. For now there is a TS problem. It should work though (but we might rethink if it is a good idea).
|
|
||
| ## Event data | ||
|
|
||
| ### Event attributes specific to `RotationGesture`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotationChange is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This PR sets the base for V3 documentation:
Test plan
Read docs 🤓