Skip to content

Conversation

@m-bert
Copy link
Contributor

@m-bert m-bert commented Dec 9, 2025

Description

This PR sets the base for V3 documentation:

  1. Moves API v2 to versioned docs
  2. Adds documentation for new hooks

Test plan

Read docs 🤓

@m-bert m-bert changed the title [docs] Pan gesture [docs] Gesture hooks Dec 10, 2025
@m-bert m-bert marked this pull request as ready for review December 16, 2025 14:39
@m-bert
Copy link
Contributor Author

m-bert commented Dec 16, 2025

CI fails because of broken links, I'll fix them, but you can still share your thoughts about the structure/content.

Comment on lines 3 to 13
### 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.
Copy link
Member

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:
image

Copy link
Contributor Author

@m-bert m-bert Dec 22, 2025

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:
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor Author

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:
Copy link
Member

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:

  1. Gesture-specific fields
  2. Continous fields
  3. Common fields

Copy link
Contributor Author

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>;
Copy link
Member

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?

Copy link
Contributor Author

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).

Copy link
Contributor Author

@m-bert m-bert Dec 22, 2025

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)

Copy link
Contributor

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>;
Copy link
Member

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?

Copy link
Contributor Author

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`:
Copy link
Member

Choose a reason for hiding this comment

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

rotationChange is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@m-bert m-bert requested a review from akwasniewski December 22, 2025 16:50
@m-bert m-bert merged commit ed1b1ef into next Dec 23, 2025
1 check passed
@m-bert m-bert deleted the @mbert/docs-v3 branch December 23, 2025 08:58
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.

4 participants