@ce1pers/use-resource
v1.0.3
Published
React native hook to initialize resources.
Downloads
2
Maintainers
Readme
@ce1pers/use-resource
React native hook to initialize resources.
Installation
npm
npm i @ce1pers/use-resource
yarn
yarn add @ce1pers/use-resource
Usage
// Import hook.
import { loadFonts,loadImages } from "@ce1pers/use-resource";
import { Ionicons } from "@expo/vector-icons";
export default function App() {
...
const loadResources = async () => {
// Add you want icons as arguments.
const fonts = loadFonts([Ionicons.font]);
await Promise.all([...fonts]);
};
...
return (
<View>
<Ionicons name="beer" size={20} />
</View>
);
}