software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
5.83k stars 952 forks source link

Add state flow charts to Gesture Handler's documentation. #2817

Closed latekvo closed 3 weeks ago

latekvo commented 1 month ago

Description

Add a flow chart to visualise state changes of gesture components.

Test plan

Run docs locally, go to the Gesture states & events article.

compatible with both Light and Dark modes

https://github.com/software-mansion/react-native-gesture-handler/assets/74246391/6c4794ac-3f02-4990-9d42-e8602c6cb10a

adaptive layout

https://github.com/software-mansion/react-native-gesture-handler/assets/74246391/3294d39a-0357-41c4-867c-39b9c3d89781

latekvo commented 1 month ago

Found some critical errors, please give me some more time before reviewing :/

latekvo commented 1 month ago

we found some bugs with @m-bert which likely are a problem within the handlers themselves. Under some circumstances, a direct transition from BEGAN to CANCELLED is possible, which doesn't follow GH's documentation.

latekvo commented 1 month ago

Does this style look better?

Received approval, applying it with the next commit.

https://github.com/software-mansion/react-native-gesture-handler/assets/74246391/58c68971-eaa4-45be-9979-7311e46cbacf

latekvo commented 1 month ago

https://github.com/software-mansion/react-native-gesture-handler/assets/74246391/214b1f48-6588-44d4-983a-37c7100a5e09