summaryrefslogtreecommitdiffhomepage
path: root/app/components/AccountInput.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-02-16 14:11:34 +0100
committerAndrej Mihajlov <and@mullvad.net>2018-02-20 17:48:28 +0100
commit2c741a45b85ec334c6c09be01f3062065c998265 (patch)
treedea0731722ebbde98157f2798d3f33c41f2ded08 /app/components/AccountInput.js
parentf58b1790b50abf340d8567b23b329ee9c0c14e3b (diff)
downloadmullvadvpn-2c741a45b85ec334c6c09be01f3062065c998265.tar.xz
mullvadvpn-2c741a45b85ec334c6c09be01f3062065c998265.zip
Fix flow annotations to work on flow v0.66
Diffstat (limited to 'app/components/AccountInput.js')
-rw-r--r--app/components/AccountInput.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/app/components/AccountInput.js b/app/components/AccountInput.js
index 4ff99e13fd..21967d856a 100644
--- a/app/components/AccountInput.js
+++ b/app/components/AccountInput.js
@@ -1,5 +1,5 @@
// @flow
-import React, { Component } from 'react';
+import * as React from 'react';
import { formatAccount } from '../lib/formatters';
// @TODO: move it into types.js
@@ -20,23 +20,21 @@ export type AccountInputProps = {
onChange: ?((newValue: string) => void);
};
-export type AccountInputState = {
+type AccountInputState = {
value: string;
selectionRange: SelectionRange;
};
-export type SelectionRange = [number, number];
+type SelectionRange = [number, number];
-export default class AccountInput extends Component {
- props: AccountInputProps;
-
- static defaultProps: AccountInputProps = {
+export default class AccountInput extends React.Component<AccountInputProps, AccountInputState> {
+ static defaultProps = {
value: '',
onEnter: null,
onChange: null
};
- state: AccountInputState = {
+ state = {
value: '',
selectionRange: [0, 0]
};
@@ -297,7 +295,7 @@ export default class AccountInput extends Component {
}
}
- onRef = (ref: HTMLInputElement) => {
+ onRef = (ref: ?HTMLInputElement) => {
this._ref = ref;
if(!ref) { return; }