INNER CODE UNIT · JavaScript

cacheImages

creativetimofficial/material-kit-react-native · App.js:37

function cacheImages(images) {
  return images.map((image) => {
    if (typeof image === "string") {
      return Image.prefetch(image);
    } else {
      return Asset.fromModule(image).downloadAsync();
    }
  });
}

export default function App() {
  const [appIsReady, setAppIsReady] = useState(false);

  useEffect(() => {
    async function prepare() {
      try {
        //Load Resources
        await _loadResourcesAsync();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…