I have the following code snippet in my react-native typescript project.
import React from 'react';
import { View, Text } from 'react-native';
import DropDownPicker from 'react-native-dropdown-picker';
const Dropdown = () =>{
<DropDownPicker
ArrowDownIconComponent={() => ( // this is the section I getting the error message
<MaterialCommunityIcons
name="home-outline"
size={50}
color={theme.colors.text}
/>
)}
/>
}
Due to es-lint, it gives the following error message:
Error message:
Declare this component outside parent component "DropDown" or memoize it. If you want to allow component creation in props, set allowAsProps option to true.eslintreact/no-unstable-nested-components
Image of the error: enter image description here
Can I know how to fix the above error, please?