Skip to content

Commit bc1efbe

Browse files
m-bertCopilot
andauthored
[Docs] Improve docs (#4325)
## Description This PR introduces few enhancements to our docs, namely: - Updates old blogpost link - Adds info about migration skill - Adds labels to `Touchable` and some deprecated components - Fixes wrongly displayed `<InteractiveExample` in top level of each section - Splits Composition page into hooks ## Test plan Read docs 🤓 --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 0bbd40f commit bc1efbe

61 files changed

Lines changed: 405 additions & 280 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/docs-gesture-handler/docs/components/reanimated_swipeable.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,30 +215,30 @@ childrenContainerStyle?: StyleProp<ViewStyle>;
215215

216216
Style object for the children container ([`Animated.View`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary/#animated-component)).
217217

218-
### simultaneousWithExternalGesture
218+
### simultaneousWith
219219

220220
```ts
221-
simultaneousWithExternalGesture?: AnyGesture | AnyGesture[];
221+
simultaneousWith?: AnyGesture | AnyGesture[];
222222
```
223223

224-
Gestures to be recognized simultaneously with the `Swipeable` (see [gesture composition section](/docs/fundamentals/gesture-composition#simultaneouswith)).
224+
Gestures to be recognized simultaneously with the `Swipeable` (see [`simultaneousWith`](/docs/composition/simultaneous-with)).
225225

226-
### requireExternalGestureToFail
226+
### requireToFail
227227

228228
```ts
229-
requireExternalGestureToFail?: AnyGesture | AnyGesture[];
229+
requireToFail?: AnyGesture | AnyGesture[];
230230
```
231231

232-
Gestures that `Swipeable` has to wait for before activating (see [gesture composition section](/docs/fundamentals/gesture-composition#simultaneouswith)).
232+
Gestures that `Swipeable` has to wait for before activating (see [`requireToFail`](/docs/composition/require-to-fail)).
233233

234234

235-
### blocksExternalGesture
235+
### block
236236

237237
```ts
238-
blocksExternalGesture?: AnyGesture | AnyGesture[];
238+
block?: AnyGesture | AnyGesture[];
239239
```
240240

241-
Gestures that `Swipeable` will prevent from activating (see [gesture composition section](/docs/fundamentals/gesture-composition#simultaneouswith)).
241+
Gestures that `Swipeable` will prevent from activating (see [`block`](/docs/composition/block)).
242242

243243
<Badges platforms={['ios', 'web']}>
244244
### enableTrackpadTwoFingerGesture

packages/docs-gesture-handler/docs/components/wrapped-components.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ Those components also receive an additional prop named `onGestureUpdate_CAN_CAUS
8787
onGestureUpdate_CAN_CAUSE_INFINITE_RERENDER?: (gesture: NativeGesture) => void;
8888
```
8989

90-
This callback is invoked when the wrapped component's underlying `Native` gesture instance or configuration changes, providing access to the underlying gesture. This can be helpful when setting up [relations](/docs/fundamentals/gesture-composition) with other gestures. You can check example usage in our [`ScrollView`](https://github.com/software-mansion/react-native-gesture-handler/blob/main/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx#L78) component.
90+
This callback is invoked when the wrapped component's underlying `Native` gesture instance or configuration changes, providing access to the underlying gesture. This can be helpful when setting up [relations](/docs/composition/overview) with other gestures. You can check example usage in our [`ScrollView`](https://github.com/software-mansion/react-native-gesture-handler/blob/main/packages/react-native-gesture-handler/src/v3/components/GestureComponents.tsx#L78) component.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Gesture composition & interactions",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index"
6+
}
7+
}

packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Competing.tsx renamed to packages/docs-gesture-handler/docs/composition/_examples/hooks/Competing.tsx

File renamed without changes.

packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Exclusive.tsx renamed to packages/docs-gesture-handler/docs/composition/_examples/hooks/Exclusive.tsx

File renamed without changes.

packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Simultaneous.tsx renamed to packages/docs-gesture-handler/docs/composition/_examples/hooks/Simultaneous.tsx

File renamed without changes.

packages/docs-gesture-handler/docs/fundamentals/_examples/props/Block.tsx renamed to packages/docs-gesture-handler/docs/composition/_examples/props/Block.tsx

File renamed without changes.

packages/docs-gesture-handler/docs/fundamentals/_examples/props/RequireToFail.tsx renamed to packages/docs-gesture-handler/docs/composition/_examples/props/RequireToFail.tsx

File renamed without changes.

packages/docs-gesture-handler/docs/fundamentals/_examples/props/SimultaneousWith.tsx renamed to packages/docs-gesture-handler/docs/composition/_examples/props/SimultaneousWith.tsx

File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
id: block
3+
title: block
4+
sidebar_label: block
5+
sidebar_position: 5
6+
---
7+
8+
import Block from '!!raw-loader!.//\_examples/props/Block';
9+
10+
`block` works similarly to `requireToFail` but the direction of the relation is reversed - instead of being a one-to-many relation, it's many-to-one. It's especially useful for making lists where the `ScrollView` component needs to wait for every gesture underneath it. All that's required to do is to pass a ref, for example:
11+
12+
<CollapsibleCode
13+
label="Show full example"
14+
expandedLabel="Hide full example"
15+
lineBounds={[22, 86]}
16+
src={Block}/>

0 commit comments

Comments
 (0)