summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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;