Skip to content

Commit 8055955

Browse files
authored
Documentation to inform of deprecated components and APIs (#501)
1 parent b9e7459 commit 8055955

24 files changed

Lines changed: 80 additions & 35 deletions

‎reason-react-native/src/apis/Animated.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,4 +296,4 @@ module View = {
296296
let make = createAnimatedComponent(View.make);
297297
};
298298
299-
```
299+
```

‎reason-react-native/src/apis/AppRegistry.re‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ type app = {
99
[@bs.meth] "getStyleElement": unit => React.element,
1010
};
1111
[@bs.module "react-native"] [@bs.scope "AppRegistry"]
12-
external getApplication: (string, {. "initialProps": 'a}) => app =
13-
"";
12+
external getApplication: (string, {. "initialProps": 'a}) => app = "";

‎reason-react-native/src/apis/AppState.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ external removeEventListener:
3030
([@bs.string] [ | `change(t => unit) | `memoryWarning(unit => unit)]) =>
3131
unit =
3232
"";
33-
33+
3434
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
id: apis/BackAndroid
3+
title: BackAndroid
4+
---
5+
6+
This API is deprecated and therefore out of scope for this project.
7+
8+
Please use [`BackHandler`](../BackHandler/) instead.

‎reason-react-native/src/apis/CameraRoll.md‎

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,57 @@ title: CameraRoll
55

66
## Methods
77

8-
- `saveToCameraRoll` allows saving photos and videos to the Camera Roll or Photo Gallery. File to be saved is specified as a tag which can be
8+
- `saveToCameraRoll` allows saving photos and videos to the Camera Roll or Photo
9+
Gallery. File to be saved is specified as a tag which can be
910

10-
- on Android, a local image or video URI, such as "file:///sdcard/img.png"
11-
- on iOS, a local video URI or any image URI (local, remote asset-library, or base64 data URIs)
11+
- on Android, a local image or video URI, such as "file:///sdcard/img.png"
12+
- on iOS, a local video URI or any image URI (local, remote asset-library, or
13+
base64 data URIs)
1214

13-
Media type (photo or video) will be automatically inferred; any file will be inferred to be a photo, unless the file extension is `mov` or `mp4`, then it will be inferred to be a video.
15+
Media type (photo or video) will be automatically inferred; any file will be
16+
inferred to be a photo, unless the file extension is `mov` or `mp4`, then it
17+
will be inferred to be a video.
1418

1519
```reason
1620
saveToCameraRoll(tag)
1721
```
1822

19-
The function will return the URI for the saved file as a string wrapped in a Promise, `Js.Promise.t(string)`.
23+
The function will return the URI for the saved file as a string wrapped in a
24+
Promise, `Js.Promise.t(string)`.
2025

21-
- `saveToCameraRollWithType` allows saving photos and videos to the Camera Roll, where the tag will be specified as above, overriding the automatically determined type.
26+
- `saveToCameraRollWithType` allows saving photos and videos to the Camera Roll,
27+
where the tag will be specified as above, overriding the automatically
28+
determined type.
2229

2330
```reason
2431
saveToCameraRollWithType(tag, _type)
2532
```
2633

2734
where `_type` can be `` `photo `` or `` `video ``.
2835

29-
The function will return the URI for the saved file as a string wrapped in a Promise, `Js.Promise.t(string)`.
36+
The function will return the URI for the saved file as a string wrapped in a
37+
Promise, `Js.Promise.t(string)`.
3038

3139
- `getPhotos` takes as argument `getPhotosParams`
3240

3341
```reason
3442
getPhotos(getPhotosParams)
3543
```
3644

37-
The function will return a `photoIdentifiersPage` object wrapped in a Promise, that is `Js.Promise.t(photoIdentifiersPage)`. Array of `photoIdentifier` will contain details of photos or videos matching parameters provided in the `getPhotosParam` object.
38-
45+
The function will return a `photoIdentifiersPage` object wrapped in a Promise,
46+
that is `Js.Promise.t(photoIdentifiersPage)`. Array of `photoIdentifier` will
47+
contain details of photos or videos matching parameters provided in the
48+
`getPhotosParam` object.
3949

4050
## Types
4151

4252
- `getPhotosParams` can be constructed with the constructor of the same name
43-
- `first` takes an integer which specifies the number of files for which details will be returned. Files will match in reverse order (i.e. most recent first)
44-
- `after` takes a string which should be obtained from `photoIdentifiersPage` returned in a previous `getPhotos` call, under the `end_cursor` key contained in turn under the `page_info` key.
53+
- `first` takes an integer which specifies the number of files for which
54+
details will be returned. Files will match in reverse order (i.e. most
55+
recent first)
56+
- `after` takes a string which should be obtained from `photoIdentifiersPage`
57+
returned in a previous `getPhotos` call, under the `end_cursor` key
58+
contained in turn under the `page_info` key.
4559

4660
```reason
4761
getPhotosParams:

‎reason-react-native/src/apis/Keyboard.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ external removeListener:
9494
[@bs.module "react-native"] [@bs.scope "Keyboard"]
9595
external dismiss: unit => unit = "";
9696
97-
```
97+
```

‎reason-react-native/src/apis/Keyboard.rei‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ external removeListener:
8585
"";
8686

8787
[@bs.module "react-native"] [@bs.scope "Keyboard"]
88-
external dismiss: unit => unit = "";
88+
external dismiss: unit => unit = "";

‎reason-react-native/src/apis/LayoutAnimation.re‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ external linear: unit => unit = "";
7070
[@bs.module "react-native"] [@bs.scope "LayoutAnimation"]
7171
external spring: unit => unit = "";
7272

73-
7473
module Presets = {
7574
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
7675
external easeInEaseOut: layoutAnimationConfig = "";
@@ -80,4 +79,4 @@ module Presets = {
8079

8180
[@bs.module "react-native"] [@bs.scope ("LayoutAnimation", "Presets")]
8281
external spring: layoutAnimationConfig = "";
83-
};
82+
};

‎reason-react-native/src/apis/Linking.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ external removeEventListener:
3636
([@bs.string] [ | `url], {. "url": string} => unit) => unit =
3737
"";
3838
39-
```
39+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
id: apis/ListViewDataSource
3+
title: ListViewDataSource
4+
---
5+
6+
This API is intended for use with the `ListView` component. As the component is
7+
deprecated, the API is out of scope for this project.
8+
9+
Instead of `ListView`, please use another list component, such as
10+
[`FlatList`](../../components/FlatList/) or
11+
[`SectionList`](../../components/SectionList/).

0 commit comments

Comments
 (0)