{this.state.categories && this.state.dishes && this.state.categories.map((item) => (
<Text style={{fontSize: 30, fontWeight: 'bold', padding: 5, backgroundColor: '#f0f0f0', borderWidth: 0.175}}>{item['dish_categories_name']}</Text>
this.filterDishesOnCategory(this.filterList(this.state.dishes), item['dish_categories_id']).map((listItem) => (
<View key={listItem['dish_name']} >
<Dish name={listItem['dish_name']} info={listItem['dish_description']} cost={listItem['dish_price']}/>
</View>
))
))}
I'm trying to map over the categories data, which then produces a text element with the name of the category. Afterwards, the dishes that are within this category are mapped through and additional dish information is displayed. However, it is clear that the Text tag and this.filterDishesOnCategory cannot be together like this. What is a possible solution to this issue?