This is my first post on StackOverflow, so apologies if I\'m not following the correct format.
I\'m building my first app using tab navigator from React Navigation
Check out the answer in the code comments.
}
// component={() => } <<<---- Although this will work but 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. You can safely remove the component attribute post adding children.
/>
Looks like you're passing an inline function for 'component' prop for the screen 'AdminTab' (e.g.
component={() =>
}). 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.