Skip to content

Commit 5f63b09

Browse files
committed
Fixed flow type errors in example
1 parent 52b7f83 commit 5f63b09

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

example/src/examples/GetSet.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import AsyncStorage from '@react-native-community/async-storage';
1515

1616
type Props = {};
1717
type State = {
18-
storedNumber: number,
18+
storedNumber: string,
1919
needRestart: boolean,
2020
};
2121
export default class GetSet extends Component<Props, State> {
2222
state = {
23-
storedNumber: -1,
23+
storedNumber: '',
2424
needRestart: false,
2525
};
2626

@@ -34,8 +34,8 @@ export default class GetSet extends Component<Props, State> {
3434
}
3535

3636
storeRandom = async () => {
37-
const randomNum = Math.round(Math.random() * 100);
38-
await AsyncStorage.setItem(STORAGE_KEY, `${randomNum}`);
37+
const randomNum = Math.round(Math.random() * 100).toString();
38+
await AsyncStorage.setItem(STORAGE_KEY, randomNum);
3939

4040
this.setState({storedNumber: randomNum, needRestart: true});
4141
};

0 commit comments

Comments
 (0)