summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-07-17 23:16:22 +0100
committerErik Larkö <erik@mullvad.net>2017-07-20 09:45:57 +0200
commitdc9001edc86456baf84bf81dabd385271378f818 (patch)
tree8d29d818aace492860c2a816e1ffdd488082f22d
parent310cca89fcd29eb5df07d8a6b144e4fe8eeab56d (diff)
downloadmullvadvpn-dc9001edc86456baf84bf81dabd385271378f818.tar.xz
mullvadvpn-dc9001edc86456baf84bf81dabd385271378f818.zip
Update Switch props
-rw-r--r--app/components/Switch.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/components/Switch.js b/app/components/Switch.js
index 46baeb8b22..e8c7edf058 100644
--- a/app/components/Switch.js
+++ b/app/components/Switch.js
@@ -6,14 +6,16 @@ import type { Point2d } from '../types';
const CLICK_TIMEOUT = 1000;
const MOVE_THRESHOLD = 10;
-export default class Switch extends Component {
- props: {
- isOn: boolean;
- onChange: ?((isOn: boolean) => void);
- }
+export type SwitchProps = {
+ isOn: boolean;
+ onChange: ?((isOn: boolean) => void);
+};
- defaultProps = {
- isOn: false
+export default class Switch extends Component {
+ props: SwitchProps;
+ static defaultProps: SwitchProps = {
+ isOn: false,
+ onChange: null
}
ref: ?HTMLInputElement;