Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interface State {
isoCurrencyCodes: any;
currentLocale: any;
preferredLocales: any;
locale?: string;
}
export default class LocalizationScreen extends React.Component<{}, State> {
static navigationOptions = {
title: 'Localization',
};
readonly state: State = {
currentLocale: Localization.locale,
preferredLocales: Localization.locales,
isoCurrencyCodes: Localization.isoCurrencyCodes,
};
queryPreferredLocales = async () => {
const preferredLocales = Localization.locales;
const currentLocale = Localization.locale;
this.setState({ preferredLocales, currentLocale });
}
queryCurrencyCodes = async () => {
if (this.state.isoCurrencyCodes.length === 0) {
const isoCurrencyCodes = Localization.isoCurrencyCodes;
this.setState({ isoCurrencyCodes });
}
}
queryPreferredLocales = async () => {
const preferredLocales = Localization.locales;
const currentLocale = Localization.locale;
this.setState({ preferredLocales, currentLocale });
}