Now I would like to get a variable from if inside same function as if like below.
renderItemBox() {
const { store } = this.props;
const currentScreen = this.props.navigation.state.routeName;
AsyncStorage.getItem('openingGenre')
.then((openingGenreValue) => {
if (currentScreen === 'EachShopGenreScreen') {
if (openingGenreValue === 'food') {
const items = this.store.restourantStore.Items;
} else {
Alert.alert('予期せぬ不具合が発生いたしました。再度お試し下さい');
}
});
return items.map((value, index) => (
//////
)
However, this code is not working, I cannot get "items" from IF on items.map~~~~
Why this is happening?
Could someone help me.