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

Guides need to show importing #2604

Closed
gaearon opened this issue Sep 21, 2023 · 3 comments · Fixed by #2607
Closed

Guides need to show importing #2604

gaearon opened this issue Sep 21, 2023 · 3 comments · Fixed by #2607
Assignees
Labels
Documentation Documentation change/enhancement will likely prevent people from encountering this problem

Comments

@gaearon
Copy link

gaearon commented Sep 21, 2023

Description

I'm reading https://docs.swmansion.com/react-native-gesture-handler/docs/quickstart/ and it's frustrating that there are no import statements. So I need to guess where to get GestureDetector, Animated.View, useSharedValue, Gesture, etc, from. This is particularly thorny because these example "span" two different libraries — also it's very easy to get confused about which Animated is being talked about.

I suggest adding clear import sections to https://docs.swmansion.com/react-native-gesture-handler/docs/quickstart/ and other guides. Ideally examples always need to be ready to be copy pasted.

Thanks!

Steps to reproduce

Open docs

Snack or a link to a repository

irrelevant

Gesture Handler version

irrelevant

React Native version

irrelevant

Platforms

Android, iOS, Web

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Platform: Web labels Sep 21, 2023
@gaearon
Copy link
Author

gaearon commented Sep 21, 2023

(I couldn't figure out where to file docs issues so filed here)

@kacperkapusciak kacperkapusciak self-assigned this Sep 22, 2023
@kacperkapusciak
Copy link
Member

Hi @gaearon 👋

it's a great suggestion!

We're well aware the Gesture Handler docs aren't in the best shape. A full-rewrite of the RNGH documentation is inevitable same as we did with Reanimated docs not so long ago but it'll take some time considering our limited resources.

In the meantime, I'll try to cleanup the docs a bit and add the imports as you suggest in #2607.

Cheers

@m-bert m-bert added Documentation Documentation change/enhancement will likely prevent people from encountering this problem and removed Platform: Web Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Missing repro labels Sep 28, 2023
kacperkapusciak added a commit that referenced this issue Sep 29, 2023
## Description

This PR aims to clean-up React Native Gesture Handler docs.

Fixes
#2604
Fixes
#2608

## Changes

### Before

Confusing sidebar with nesting and hard to find pages for newcomers



https://github.com/software-mansion/react-native-gesture-handler/assets/39658211/3263431a-60f5-4aeb-98a8-3b9aa66fa4fe



### After

Open sidebar with one level of page nesting



https://github.com/software-mansion/react-native-gesture-handler/assets/39658211/1471ebb3-87b4-4cae-96a1-a76fe9cacc50


### Before

A lot of versions which many of them are duplicates with a couple of
changes eg. one function added



https://github.com/software-mansion/react-native-gesture-handler/assets/39658211/b4f7b818-dce8-49a7-b23e-df6db931a5b7



### After

2 major versions same as the library



https://github.com/software-mansion/react-native-gesture-handler/assets/39658211/5c5105d4-2c69-4179-8ae3-0e4204131708


### Also

- Added imports to examples
- Fix examples in Gestures so they can be copied, compiled and run
without any changes
- Added a couple of videos showcasing the gestures
- Made redirects from old versions to the new ones (a bit flaky tbh) 


## Test plan

```
cd docs/
yarn
yarn start
```

---------

Co-authored-by: Jakub Piasecki <jakub.piasecki@swmansion.com>
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation change/enhancement will likely prevent people from encountering this problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants