git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on main help sign in
Declare gesture package requirements
commit9be7f8e049a2741de14ff405f12ff1f9a4911a25 authorMark <mark.eibes@gmail.com> dateSat 11 Jul 2026, 19:12 (3 months ago) parenta5447b7
3 files changed+46−8
README.md+38−8 spago.lock+6 spago.yaml+2
README.md+38−8
@@ -36,17 +36,47 @@ For a physical iPhone, connect and trust the device, select an Apple Development
3636
3737## Using in Your Project
3838
39−Add to `spago.yaml`:
39+Add the package dependency and source locations to `spago.yaml`:
4040```yaml
41−extraPackages:
42− yoga-react-native:
43− git: https://github.com/rowtype-yoga/purescript-yoga-react-native.git
44− ref: main
45− yoga-react:
46− git: https://github.com/rowtype-yoga/purescript-yoga-react.git
47− ref: main
41+package:
42+ dependencies:
43+ - yoga-react-native
44+
45+workspace:
46+ extraPackages:
47+ yoga-react-native:
48+ git: https://github.com/rowtype-yoga/purescript-yoga-react-native.git
49+ ref: main
50+ yoga-react:
51+ git: https://github.com/rowtype-yoga/purescript-yoga-react.git
52+ ref: main
4853```
4954
55+The gesture bindings have one required JavaScript peer dependency. Install the React Native 0.81-compatible release with Bun:
56+
57+```bash
58+bun add react-native-gesture-handler@2.28.0
59+```
60+
61+Autolink the native dependency on each Apple target after installation:
62+
63+```bash
64+cd ios && pod install && cd ..
65+# For a react-native-macos target as well:
66+cd macos && pod install && cd ..
67+```
68+
69+Wrap the registered application with `GestureHandlerRootView` before rendering gesture-backed components:
70+
71+```purescript
72+import Yoga.React.Native.GestureHandler (gestureHandlerRootView)
73+
74+app :: {} -> JSX
75+app _ = gestureHandlerRootView application
76+```
77+
78+`Yoga.React.Native.GestureHandler` imports `react-native-gesture-handler` directly; applications that use this module must provide the JavaScript package and linked native pod. The wrapper must be above every `panGestureView` in the rendered tree.
79+
5080```purescript
5181import Yoga.React.Native (text, tw, view)
5282import Yoga.React.Native.MacOS.Button (nativeButton)
spago.lock+6
@@ -8,6 +8,9 @@
88 {
99 "aff": ">=7.1.0 <8.0.0"
1010 },
11+ {
12+ "arrays": ">=7.3.0 <8.0.0"
13+ },
1114 {
1215 "effect": ">=4.0.0 <5.0.0"
1316 },
@@ -26,6 +29,9 @@
2629 {
2730 "nullable": ">=6.0.0 <7.0.0"
2831 },
32+ {
33+ "numbers": ">=9.0.1 <10.0.0"
34+ },
2935 {
3036 "prelude": ">=6.0.1 <7.0.0"
3137 },
spago.yaml+2
@@ -7,6 +7,7 @@ package:
77 githubOwner: rowtype-yoga
88 githubRepo: purescript-yoga-react-native
99 dependencies:
10+ - arrays: ">=7.3.0 <8.0.0"
1011 - aff: ">=7.1.0 <8.0.0"
1112 - effect: ">=4.0.0 <5.0.0"
1213 - foreign: ">=7.0.0 <8.0.0"
@@ -14,6 +15,7 @@ package:
1415 - maybe: ">=6.0.0 <7.0.0"
1516 - newtype: ">=5.0.0 <6.0.0"
1617 - nullable: ">=6.0.0 <7.0.0"
18+ - numbers: ">=9.0.1 <10.0.0"
1719 - prelude: ">=6.0.1 <7.0.0"
1820 - react-basic: ">=17.0.0 <18.0.0"
1921 - react-basic-hooks: ">=8.2.0 <9.0.0"