Skip to content

Commit 840434a

Browse files
committed
Remove Switch onTintColor, thumbTintColor & tintColor props
I didn't find a way to deprecate that. Closes #320
1 parent 3850915 commit 840434a

3 files changed

Lines changed: 15 additions & 45 deletions

File tree

‎lib/js/src/components/switch.js‎

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/components/switch.re‎

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
open Belt;
2+
13
[@bs.module "react-native"] external view: ReasonReact.reactClass = "Switch";
24

35
let make =
@@ -6,11 +8,8 @@ let make =
68
~trackColorTrue: option(string)=?,
79
~trackColorFalse: option(string)=?,
810
~iosBackgroundColor: option(string)=?,
9-
~onTintColor: option(string)=?,
1011
~onValueChange: option(bool => unit)=?,
11-
~thumbTintColor: option(string)=?,
1212
~thumbColor: option(string)=?,
13-
~tintColor: option(string)=?,
1413
~value: option(bool)=?,
1514
~accessibilityLabel=?,
1615
~accessible=?,
@@ -46,32 +45,19 @@ let make =
4645
"disabled": disabled,
4746
"onValueChange": onValueChange,
4847
"trackColor": {
49-
let d = Js.Dict.empty();
50-
Js.Dict.set(
51-
d,
52-
"true",
53-
Belt.Option.mapWithDefault(
54-
trackColorTrue,
48+
"true":
49+
trackColorTrue->Option.mapWithDefault(
5550
Js.Nullable.null,
5651
Js.Nullable.return,
5752
),
58-
);
59-
Js.Dict.set(
60-
d,
61-
"false",
62-
Belt.Option.mapWithDefault(
63-
trackColorFalse,
53+
"false":
54+
trackColorFalse->Option.mapWithDefault(
6455
Js.Nullable.null,
6556
Js.Nullable.return,
6657
),
67-
);
68-
d;
6958
},
7059
"ios_backgroundColor": iosBackgroundColor,
71-
"onTintColor": onTintColor,
72-
"thumbTintColor": thumbTintColor,
7360
"thumbColor": thumbColor,
74-
"tintColor": tintColor,
7561
},
7662
~accessibilityLabel?,
7763
~accessible?,

‎src/components/switch.rei‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,14 @@ As of React Native version 0.57, [tintColor], [onTintColor] and [thumbTintColor]
2525
{[
2626
~iosBackgroundColor: string=?
2727
]}
28-
{4 onTintColor}
29-
{[
30-
~onTintColor: string=?
31-
]}
3228
{4 onValueChange}
3329
{[
3430
~onValueChange: bool => unit=?
3531
]}
36-
{4 thumbTintColor}
37-
{[
38-
~thumbTintColor: string=?
39-
]}
4032
{4 thumbColor}
4133
{[
4234
~thumbColor: string=?
4335
]}
44-
{4 tintColor}
45-
{[
46-
~tintColor: string=?
47-
]}
4836
{4 value}
4937
{[
5038
~value: bool=?
@@ -57,11 +45,8 @@ let make:
5745
~trackColorTrue: string=?,
5846
~trackColorFalse: string=?,
5947
~iosBackgroundColor: string=?,
60-
~onTintColor: string=?,
6148
~onValueChange: bool => unit=?,
62-
~thumbTintColor: string=?,
6349
~thumbColor: string=?,
64-
~tintColor: string=?,
6550
~value: bool=?,
6651
~accessibilityLabel: ReasonReact.reactElement=?,
6752
~accessible: bool=?,
@@ -93,4 +78,4 @@ let make:
9378
ReasonReact.stateless,
9479
ReasonReact.noRetainedProps,
9580
unit,
96-
);
81+
);

0 commit comments

Comments
 (0)