Skip to content

Commit e639687

Browse files
cknittMoOx
authored andcommitted
Add ref prop everywhere. (#435)
1 parent 1b8d992 commit e639687

46 files changed

Lines changed: 240 additions & 54 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎reason-react-native/src/components/ActivityIndicator.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ wip: true
55
---
66

77
```reason
8+
type element;
9+
type ref = React.Ref.t(Js.nullable(element));
10+
811
type size;
912
1013
let small: size = "small"->Obj.magic;
@@ -14,6 +17,8 @@ external exactSize: float => size = "%identity";
1417
[@react.component] [@bs.module "react-native"]
1518
external make:
1619
(
20+
~ref: ref=?,
21+
// ActivityIndicator props
1722
~animating: bool=?,
1823
~color: Style.color=?,
1924
~size: size=?,

‎reason-react-native/src/components/ActivityIndicator.re‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
type element;
2+
type ref = React.Ref.t(Js.nullable(element));
3+
14
type size;
25

36
let small: size = "small"->Obj.magic;
@@ -7,6 +10,8 @@ external exactSize: float => size = "%identity";
710
[@react.component] [@bs.module "react-native"]
811
external make:
912
(
13+
~ref: ref=?,
14+
// ActivityIndicator props
1015
~animating: bool=?,
1116
~color: Style.color=?,
1217
~size: size=?,

‎reason-react-native/src/components/Button.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ wip: true
55
---
66

77
```reason
8+
type element;
9+
type ref = React.Ref.t(Js.nullable(element));
10+
811
[@react.component] [@bs.module "react-native"]
912
external make:
1013
(
14+
~ref: ref=?,
15+
// Button props
1116
~accessibilityLabel: string=?,
1217
~color: Style.color=?,
1318
~disabled: bool=?,

‎reason-react-native/src/components/Button.re‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
type element;
2+
type ref = React.Ref.t(Js.nullable(element));
3+
14
[@react.component] [@bs.module "react-native"]
25
external make:
36
(
7+
~ref: ref=?,
8+
// Button props
49
~accessibilityLabel: string=?,
510
~color: Style.color=?,
611
~disabled: bool=?,

‎reason-react-native/src/components/DrawerLayoutAndroid.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type drawerSlideEvent = Event.syntheticEvent({. "offset": float});
2222
external make:
2323
(
2424
~ref: ref=?,
25+
// DrawerLayoutAndroid props
2526
~renderNavigationView: unit => React.element,
2627
~onDrawerClose: unit => unit=?,
2728
~drawerPosition: drawerPosition=?,

‎reason-react-native/src/components/DrawerLayoutAndroid.re‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type drawerSlideEvent = Event.syntheticEvent({. "offset": float});
1515
external make:
1616
(
1717
~ref: ref=?,
18+
// DrawerLayoutAndroid props
1819
~renderNavigationView: unit => React.element,
1920
~onDrawerClose: unit => unit=?,
2021
~drawerPosition: drawerPosition=?,

‎reason-react-native/src/components/Image.md‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ wip: true
55
---
66

77
```reason
8+
type element;
9+
type ref = React.Ref.t(Js.nullable(element));
10+
811
type uriSource;
912
1013
[@bs.obj]
@@ -50,7 +53,7 @@ module DefaultSource = {
5053
external fromRequired: Packager.required => t = "%identity";
5154
};
5255
53-
type imageErrorEvent = Event.syntheticEvent({. "error": string});
56+
type errorEvent = Event.syntheticEvent({. "error": string});
5457
5558
type progress = {
5659
.
@@ -61,11 +64,24 @@ type progress = {
6164
[@react.component] [@bs.module "react-native"]
6265
external make:
6366
(
64-
~onError: imageErrorEvent => unit=?,
67+
~ref: ref=?,
68+
// Image props
69+
~accessibilityLabel: string=?,
70+
~accessible: bool=?,
71+
~blurRadius: float=?,
72+
~capInsets: Types.edgeInsets=?,
73+
~defaultSource: DefaultSource.t=?,
74+
~fadeDuration: float=?,
75+
~loadingIndicatorSource: array(Source.t)=?,
76+
~onError: errorEvent => unit=?,
6577
~onLayout: Event.layoutEvent => unit=?,
6678
~onLoad: unit => unit=?,
6779
~onLoadEnd: unit => unit=?,
6880
~onLoadStart: unit => unit=?,
81+
~onPartialLoad: unit => unit=?,
82+
~onProgress: progress => unit=?,
83+
~progressiveRenderingEnabled: bool=?,
84+
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
6985
~resizeMode: [@bs.string] [
7086
| `center
7187
| `contain
@@ -76,15 +92,7 @@ external make:
7692
=?,
7793
~source: Source.t,
7894
~style: Style.t=?,
79-
~testID: string=?,
80-
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
81-
~accessibilityLabel: string=?,
82-
~accessible: bool=?,
83-
~blurRadius: float=?,
84-
~capInsets: Types.edgeInsets=?,
85-
~defaultSource: DefaultSource.t=?,
86-
~onPartialLoad: unit => unit=?,
87-
~onProgress: progress => unit=?
95+
~testID: string=?
8896
) =>
8997
React.element =
9098
"Image";

‎reason-react-native/src/components/Image.re‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
type element;
2+
type ref = React.Ref.t(Js.nullable(element));
3+
14
type uriSource;
25

36
[@bs.obj]
@@ -43,7 +46,7 @@ module DefaultSource = {
4346
external fromRequired: Packager.required => t = "%identity";
4447
};
4548

46-
type imageErrorEvent = Event.syntheticEvent({. "error": string});
49+
type errorEvent = Event.syntheticEvent({. "error": string});
4750

4851
type progress = {
4952
.
@@ -54,11 +57,24 @@ type progress = {
5457
[@react.component] [@bs.module "react-native"]
5558
external make:
5659
(
57-
~onError: imageErrorEvent => unit=?,
60+
~ref: ref=?,
61+
// Image props
62+
~accessibilityLabel: string=?,
63+
~accessible: bool=?,
64+
~blurRadius: float=?,
65+
~capInsets: Types.edgeInsets=?,
66+
~defaultSource: DefaultSource.t=?,
67+
~fadeDuration: float=?,
68+
~loadingIndicatorSource: array(Source.t)=?,
69+
~onError: errorEvent => unit=?,
5870
~onLayout: Event.layoutEvent => unit=?,
5971
~onLoad: unit => unit=?,
6072
~onLoadEnd: unit => unit=?,
6173
~onLoadStart: unit => unit=?,
74+
~onPartialLoad: unit => unit=?,
75+
~onProgress: progress => unit=?,
76+
~progressiveRenderingEnabled: bool=?,
77+
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
6278
~resizeMode: [@bs.string] [
6379
| `center
6480
| `contain
@@ -69,15 +85,7 @@ external make:
6985
=?,
7086
~source: Source.t,
7187
~style: Style.t=?,
72-
~testID: string=?,
73-
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
74-
~accessibilityLabel: string=?,
75-
~accessible: bool=?,
76-
~blurRadius: float=?,
77-
~capInsets: Types.edgeInsets=?,
78-
~defaultSource: DefaultSource.t=?,
79-
~onPartialLoad: unit => unit=?,
80-
~onProgress: progress => unit=?
88+
~testID: string=?
8189
) =>
8290
React.element =
8391
"Image";

‎reason-react-native/src/components/ImageBackground.md‎

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,27 @@ external imageStyle:
4242
[@react.component] [@bs.module "react-native"]
4343
external make:
4444
(
45-
~imageRef: ref=?,
45+
~ref: ref=?,
46+
// ImageBackground props
47+
~imageRef: Image.ref=?,
48+
~imageStyle: imageStyle=?,
49+
// Image props
50+
~accessibilityLabel: string=?,
51+
~accessible: bool=?,
52+
~blurRadius: float=?,
53+
~capInsets: Types.edgeInsets=?,
54+
~defaultSource: Image.DefaultSource.t=?,
55+
~fadeDuration: float=?,
56+
~loadingIndicatorSource: array(Image.Source.t)=?,
57+
~onError: Image.errorEvent => unit=?,
4658
~onLayout: Event.layoutEvent => unit=?,
4759
~onLoad: unit => unit=?,
4860
~onLoadEnd: unit => unit=?,
4961
~onLoadStart: unit => unit=?,
62+
~onPartialLoad: unit => unit=?,
63+
~onProgress: Image.progress => unit=?,
64+
~progressiveRenderingEnabled: bool=?,
65+
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
5066
~resizeMode: [@bs.string] [
5167
| `center
5268
| `contain
@@ -57,19 +73,7 @@ external make:
5773
=?,
5874
~source: Image.Source.t,
5975
~style: Style.t=?,
60-
~imageStyle: imageStyle=?,
61-
~testID: string=?,
62-
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
63-
~accessibilityLabel: string=?,
64-
~accessible: bool=?,
65-
~blurRadius: float=?,
66-
~capInsets: Types.edgeInsets=?,
67-
~defaultSource: Image.DefaultSource.t=?,
68-
~onPartialLoad: unit => unit=?,
69-
~onProgress: Image.progress => unit=?,
70-
~fadeDuration: float=?,
71-
~progressiveRenderingEnabled: bool=?,
72-
~children: React.element=?
76+
~testID: string=?
7377
) =>
7478
React.element =
7579
"ImageBackground";

‎reason-react-native/src/components/ImageBackground.re‎

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,27 @@ external imageStyle:
3535
[@react.component] [@bs.module "react-native"]
3636
external make:
3737
(
38-
~imageRef: ref=?,
38+
~ref: ref=?,
39+
// ImageBackground props
40+
~imageRef: Image.ref=?,
41+
~imageStyle: imageStyle=?,
42+
// Image props
43+
~accessibilityLabel: string=?,
44+
~accessible: bool=?,
45+
~blurRadius: float=?,
46+
~capInsets: Types.edgeInsets=?,
47+
~defaultSource: Image.DefaultSource.t=?,
48+
~fadeDuration: float=?,
49+
~loadingIndicatorSource: array(Image.Source.t)=?,
50+
~onError: Image.errorEvent => unit=?,
3951
~onLayout: Event.layoutEvent => unit=?,
4052
~onLoad: unit => unit=?,
4153
~onLoadEnd: unit => unit=?,
4254
~onLoadStart: unit => unit=?,
55+
~onPartialLoad: unit => unit=?,
56+
~onProgress: Image.progress => unit=?,
57+
~progressiveRenderingEnabled: bool=?,
58+
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
4359
~resizeMode: [@bs.string] [
4460
| `center
4561
| `contain
@@ -50,19 +66,7 @@ external make:
5066
=?,
5167
~source: Image.Source.t,
5268
~style: Style.t=?,
53-
~imageStyle: imageStyle=?,
54-
~testID: string=?,
55-
~resizeMethod: [@bs.string] [ | `auto | `resize | `scale]=?,
56-
~accessibilityLabel: string=?,
57-
~accessible: bool=?,
58-
~blurRadius: float=?,
59-
~capInsets: Types.edgeInsets=?,
60-
~defaultSource: Image.DefaultSource.t=?,
61-
~onPartialLoad: unit => unit=?,
62-
~onProgress: Image.progress => unit=?,
63-
~fadeDuration: float=?,
64-
~progressiveRenderingEnabled: bool=?,
65-
~children: React.element=?
69+
~testID: string=?
6670
) =>
6771
React.element =
6872
"ImageBackground";

0 commit comments

Comments
 (0)