Skip to content

Commit 8675da9

Browse files
authored
Merge pull request #3 from Naturalclar/docs/updateREAMDE
docs: update README
2 parents a653b7d + 3f64e85 commit 8675da9

File tree

1 file changed

+49
-26
lines changed

1 file changed

+49
-26
lines changed

README.md

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
**How to use this template**
2-
3-
- Put your bindings in `src/ReactNativeViewPager` & rename accordingly or use
4-
`bsconfig.json` `"namespace"` field (more on this below),
5-
- Update all occurences of
6-
7-
- `@reason-react-native/viewpager`
8-
- `https://github.com/reason-react-native/viewpager`
9-
- `viewpager`
10-
- `@react-native-community/viewpager`
11-
- `https://github.com/react-native-community/react-native-viewpager`
12-
- `ReactNativeViewPager`. If you have more than a file exposed, you should
13-
consider using BuckleScript custom namespace by adjusting `bsconfig.json`
14-
and adding a `"namespace": "react-native-something"` (note that it will be
15-
converted to `ReactNativeViewPager`)
16-
17-
- Add your `@react-native-community/viewpager` (adjusted) in `peerDependencies`
18-
& `devDependencies` section
19-
- Adjust the changelog (and/or clean it)
20-
- Remove this part ⬆ & keep everything below ⬇
21-
22-
---
23-
241
# `@reason-react-native/viewpager`
252

263
[![Build Status](https://github.com/reason-react-native/viewpager/workflows/Build/badge.svg)](https://github.com/reason-react-native/viewpager/actions)
@@ -67,17 +44,63 @@ yarn add @reason-react-native/viewpager
6744

6845
## Usage
6946

47+
```reason
48+
[@react.component]
49+
let app = () =>
50+
<SafeAreaView style={styles##body}>
51+
<ReactNativeViewPager style={styles##body}
52+
initialPage=1
53+
pageMargin=13
54+
transitionStyle={`curl}
55+
showPageIndicator=true
56+
>
57+
<View style={styles##red}/>
58+
<View style={styles##blue}/>
59+
<View style={styles##green}/>
60+
</ReactNativeViewPager>
61+
</SafeAreaView>;
62+
```
63+
7064
### Types
7165

7266
#### `ReactNativeViewPager.t`
7367

74-
...
68+
```reason
69+
~ref: ref=?,
70+
~initialPage: int=?,
71+
~scrollEnabled: bool=?,
72+
~onPageScroll: ReactNative.Event.syntheticEvent(scrollEvent) => unit=?,
73+
~onPageSelected: ReactNative.Event.syntheticEvent(selectedEvent) => unit=?,
74+
~onPageScrollStateChanged: ReactNative.Event.syntheticEvent(
75+
scrollStateChangedEvent,
76+
) =>
77+
unit
78+
=?,
79+
~keyboardDismissMode: [@bs.string] [ | `none | [@bs.as "on-drag"] `onDrag]
80+
=?,
81+
~pageMargin: int=?,
82+
~onMoveShouldSetResponderCapture: ReactNative.Event.pressEvent => bool=?,
83+
~style: ReactNative.Style.t=?,
84+
~children: React.element=?,
85+
~orientation: [@bs.string] [ | `horizontal | `vertical]=?,
86+
~transitionStyle: [@bs.string] [ | `scroll | `curl]=?,
87+
~showPageIndicator: bool=?
88+
```
7589

7690
### Methods
7791

78-
#### `ReactNativeViewPager.method`
92+
#### `ReactNativeViewPager.setPage`
93+
94+
```reason
95+
setPage: (T.t, int) => unit = "setPage";
96+
```
7997

80-
...
98+
#### `ReactNativeViewPager.setPage`
99+
100+
```reason
101+
setPageWithoutAnimation: (T.t, int) => unit =
102+
"setPageWithoutAnimation";
103+
```
81104

82105
---
83106

0 commit comments

Comments
 (0)