1
- ## How to use this template
2
-
3
- - ⚠️ ** Don't fork this repository.** Use the "Use this template" green GitHub
4
- button.
5
- - Put your bindings in ` src/ReactNativeXxxxxxxxxx ` & rename accordingly or use
6
- ` rescript.json ` ` "namespace" ` field (more on this below),
7
- - Update all occurences of
8
-
9
- - ` @rescript-react-native/__template__ `
10
- - ` https://github.com/rescript-react-native/__template__ `
11
- - ` __template__ `
12
- - ` react-native-XXXXXXXXXX `
13
- - ` https://github.com/OWNER/react-native-XXXXXXXXXX `
14
- - ` ReactNativeXxxxxxxxxx ` . If you have more than a file exposed, you should
15
- consider using ReScript custom namespace by adjusting ` rescript.json `
16
- and adding a ` "namespace": "react-native-something" ` (note that it will be
17
- converted to ` ReactNativeXxxxxxxxxx ` )
18
-
19
- - Add your ` react-native-XXXXXXXXXX ` (adjusted) in ` peerDependencies `
20
- & ` devDependencies ` section
21
- - Adjust the changelog (and/or clean it)
22
- - Remove this part ⬆ & keep everything below ⬇
1
+ # ` @rescript-react-native/flash-list `
23
2
24
- ---
25
-
26
- # ` @rescript-react-native/__template__ `
27
-
28
- [ ![ Build Status] ( https://github.com/rescript-react-native/__template__/workflows/Build/badge.svg )] ( https://github.com/rescript-react-native/__template__/actions )
29
- [ ![ Version] ( https://img.shields.io/npm/v/@rescript-react-native/__template__.svg )] ( https://www.npmjs.com/@rescript-react-native/__template__ )
3
+ [ ![ Build Status] ( https://github.com/rescript-react-native/flash-list/workflows/Build/badge.svg )] ( https://github.com/rescript-react-native/flash-list/actions )
4
+ [ ![ Version] ( https://img.shields.io/npm/v/@rescript-react-native/flash-list.svg )] ( https://www.npmjs.com/@rescript-react-native/flash-list )
30
5
[ ![ ReScript Forum] ( https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org )] ( https://forum.rescript-lang.org/ )
31
6
32
7
[ ReScript] ( https://rescript-lang.org ) bindings for
33
- [ ` react-native-XXXXXXXXXX ` ] ( https://github.com/OWNER/react-native-XXXXXXXXXX ) .
8
+ [ ` flash-list ` ] ( https://github.com/Shopify/flash-list ) .
34
9
35
- Exposed as ` ReactNativeXxxxxxxxxx ` module.
10
+ Exposed as ` FlashList ` module.
36
11
37
- ` @rescript-react-native/__template__ ` X.y.\* means it's compatible with
38
- ` react-native-XXXXXXXXXX ` X.y.\*
12
+ ` @rescript-react-native/flash-list ` X.y.\* means it's compatible with
13
+ ` @shopify/flash-list ` X.y.\*
39
14
40
15
## Installation
41
16
42
17
When
43
- [ ` react-native-XXXXXXXXXX ` ] ( https://github.com/OWNER/react-native-XXXXXXXXXX )
18
+ [ ` @shopify/flash-list ` ] ( https://github.com/Shopify/flash-list )
44
19
is properly installed & configured by following their installation instructions,
45
20
you can install the bindings:
46
21
47
22
``` console
48
- npm install @rescript-react-native/__template__
23
+ npm install @rescript-react-native/flash-list
49
24
# or
50
- yarn add @rescript-react-native/__template__
25
+ yarn add @rescript-react-native/flash-list
51
26
```
52
27
53
- ` @rescript-react-native/__template__ ` should be added to ` bs-dependencies ` in your
28
+ ` @rescript-react-native/flash-list ` should be added to ` bs-dependencies ` in your
54
29
` rescript.json ` :
55
30
56
31
``` diff
@@ -60,25 +35,33 @@ yarn add @rescript-react-native/__template__
60
35
"@rescript/react",
61
36
"rescript-react-native",
62
37
// ...
63
- + "@rescript-react-native/__template__ "
38
+ + "@rescript-react-native/flash-list "
64
39
],
65
40
//...
66
41
}
67
42
```
68
43
69
44
## Usage
70
45
71
- ### Types
72
-
73
- #### ` ReactNativeXxxxxxxxxx.t `
74
-
75
- ...
76
-
77
46
### Methods
78
47
79
- #### ` ReactNativeXxxxxxxxxx.method `
80
-
81
- ...
48
+ #### ` <FlashList> `
49
+
50
+ ``` rescript
51
+ open ReactNative;
52
+
53
+ @react.component
54
+ let make = () => {
55
+ <FlashList
56
+ data={[{"id": "1", "name": "Foo"}]}
57
+ keyExtractor={(item, _) => item["id"]}
58
+ renderItem={({item}) =>
59
+ <View>
60
+ <Text> {item["name"]->React.string} </Text>
61
+ </View>}
62
+ />
63
+ }
64
+ ```
82
65
83
66
---
84
67
0 commit comments