@baont97/rn-loader
v0.1.0
Published
Display a loader on top of app
Downloads
15
Readme
rn-loader
Display a loader on top of app
Installation
yarn add @baont97/rn-loader
Usage
import { LoaderProvider, useLoader } from 'rn-loader';
// ...
<LoaderProvider>
<HomeScreen />
</LoaderProvider>
const HomeScreen: React.FC = () => {
const loader = useLoader();
const onPress = () => {
loader.show();
setTimeout(() => loader.hide(), 3000);
};
return (
<View style={$root}>
<Button title="Show modal" onPress={onPress} />
</View>
);
};