react-native-unmount
v0.2.0
Published
Unmount inactive views to save memory
Maintainers
Readme
React Native Unmount
Unmount inactive views to save memory!
Installation
npm install react-native-unmountUsage
import { useIsFocused } from '@react-navigation/native';
import { UnmountProvider, UnmountWrapper } from 'react-native-unmount';
function HomeScreen() {
// Use React Navigation or any other navigation library
const isActive = useIsFocused();
return (
<UnmountProvider isActive={isActive}>
<LightContent />
<UnmountWrapper>
<HeavyComponent />
</UnmountWrapper>
</UnmountProvider>
);
}Contributing
License
MIT
Made with create-react-native-library
