I'm new to react native and something is really confusing to me. What type of objects should I cleanup before the component unMount? I know I should clean all the API calls, what else?? Let's say I have a button like this
const _renderTruncatedFooter = (handlePress) => {
return (
<Text
onPress={handlePress}>
Read more
</Text>
);
};
Should I cleanup buttons in useEffect return?
You don't clean up any objects. You only clean up side effects like API calls, event listeners, timers, etc.
Objects and functions will be cleaned up by garbage collection.