I got this warning :
"Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour".
I try to pass the item parameter to the "Neptun" component function type and then I get the above error.
How can I fix this issue ?
<Tab.Screen
name="FOOD"
component={() => <Neptun item={item} />}
listeners={({ route }) => ({
focus: () => {
dispatch(
setCurrentTabInfoAction({
currentTabName: route.name,
type: 'approved',
})
);
},
})}
/>
<Tab.Screen