This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

18 lines
653 B
TypeScript

import { Asset } from './Asset';
/**
* Downloads and stores one or more assets locally.
* After the assets are loaded, this hook returns a list of asset instances.
* If something went wrong when loading the assets, an error is returned.
*
* Note, the assets are not "reloaded" when you dynamically change the asset list.
*
* @see https://docs.expo.io/versions/latest/sdk/asset/
* @example
* ```tsx
* const [assets, error] = useAssets(require('path/to/asset.jpg'));
*
* return !assets ? null : <Image source={assets[0]} />;
* ```
*/
export declare function useAssets(moduleIds: number | number[]): [Asset[] | undefined, Error | undefined];