How to use the expo.Asset.fromModule function in expo

To help you get started, we’ve selected a few expo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / home / components / Profile.js View on Github external
async componentWillMount() {
    this._isMounted = true;
    await Asset.fromModule(require('../assets/banner-image.png')).downloadAsync();
  }
github expo / expo-three / example / screens / AR / Image.js View on Github external
addDetectionImageAsync = async (resource, width = 0.254) => {
    let asset = Asset.fromModule(resource);
    await asset.downloadAsync();
    await AR.setDetectionImagesAsync({
      icon: {
        uri: asset.localUri,
        name: asset.name,
        width,
      },
    });
  };
github clintmod / login-example-react-native-expo-react-navigation-mobx-nativebase-typescript / src / components / images / Images.ts View on Github external
public static downloadAsync(): Array> {
    return [
      Asset.fromModule(Images.login).downloadAsync(),
      Asset.fromModule(Images.signUp).downloadAsync(),
      Asset.fromModule(Images.drawer).downloadAsync(),
      Asset.fromModule(Images.home).downloadAsync(),
      Asset.fromModule(Images.lists).downloadAsync(),
      Asset.fromModule(Images.timeline).downloadAsync(),

      Asset.fromModule(Images.defaultAvatar).downloadAsync(),
      Asset.fromModule(Images.avatar1).downloadAsync(),
      Asset.fromModule(Images.avatar2).downloadAsync(),
      Asset.fromModule(Images.avatar3).downloadAsync(),

      Asset.fromModule(Images.foodGroup).downloadAsync(),
      Asset.fromModule(Images.workGroup).downloadAsync(),
      Asset.fromModule(Images.vacationGroup).downloadAsync(),
      Asset.fromModule(Images.citiesGroup).downloadAsync(),
    ];
github syousif94 / frugalmaps / frugalapp / src / CacheAssets.js View on Github external
return images.map(image => {
    if (typeof image === "string") {
      return Image.prefetch(image);
    } else {
      return Asset.fromModule(image).downloadAsync();
    }
  });
}
github clintmod / login-example-react-native-expo-react-navigation-mobx-nativebase-typescript / src / components / images / Images.ts View on Github external
public static downloadAsync(): Array> {
    return [
      Asset.fromModule(Images.login).downloadAsync(),
      Asset.fromModule(Images.signUp).downloadAsync(),
      Asset.fromModule(Images.drawer).downloadAsync(),
      Asset.fromModule(Images.home).downloadAsync(),
      Asset.fromModule(Images.lists).downloadAsync(),
      Asset.fromModule(Images.timeline).downloadAsync(),

      Asset.fromModule(Images.defaultAvatar).downloadAsync(),
      Asset.fromModule(Images.avatar1).downloadAsync(),
      Asset.fromModule(Images.avatar2).downloadAsync(),
      Asset.fromModule(Images.avatar3).downloadAsync(),

      Asset.fromModule(Images.foodGroup).downloadAsync(),
      Asset.fromModule(Images.workGroup).downloadAsync(),
      Asset.fromModule(Images.vacationGroup).downloadAsync(),
      Asset.fromModule(Images.citiesGroup).downloadAsync(),
    ];
  }
}
github clintmod / login-example-react-native-expo-react-navigation-mobx-nativebase-typescript / src / components / images / Images.ts View on Github external
public static downloadAsync(): Array> {
    return [
      Asset.fromModule(Images.login).downloadAsync(),
      Asset.fromModule(Images.signUp).downloadAsync(),
      Asset.fromModule(Images.drawer).downloadAsync(),
      Asset.fromModule(Images.home).downloadAsync(),
      Asset.fromModule(Images.lists).downloadAsync(),
      Asset.fromModule(Images.timeline).downloadAsync(),

      Asset.fromModule(Images.defaultAvatar).downloadAsync(),
      Asset.fromModule(Images.avatar1).downloadAsync(),
      Asset.fromModule(Images.avatar2).downloadAsync(),
      Asset.fromModule(Images.avatar3).downloadAsync(),

      Asset.fromModule(Images.foodGroup).downloadAsync(),
      Asset.fromModule(Images.workGroup).downloadAsync(),
      Asset.fromModule(Images.vacationGroup).downloadAsync(),
      Asset.fromModule(Images.citiesGroup).downloadAsync(),
    ];
  }
}
github clintmod / login-example-react-native-expo-react-navigation-mobx-nativebase-typescript / src / components / images / Images.ts View on Github external
Asset.fromModule(Images.login).downloadAsync(),
      Asset.fromModule(Images.signUp).downloadAsync(),
      Asset.fromModule(Images.drawer).downloadAsync(),
      Asset.fromModule(Images.home).downloadAsync(),
      Asset.fromModule(Images.lists).downloadAsync(),
      Asset.fromModule(Images.timeline).downloadAsync(),

      Asset.fromModule(Images.defaultAvatar).downloadAsync(),
      Asset.fromModule(Images.avatar1).downloadAsync(),
      Asset.fromModule(Images.avatar2).downloadAsync(),
      Asset.fromModule(Images.avatar3).downloadAsync(),

      Asset.fromModule(Images.foodGroup).downloadAsync(),
      Asset.fromModule(Images.workGroup).downloadAsync(),
      Asset.fromModule(Images.vacationGroup).downloadAsync(),
      Asset.fromModule(Images.citiesGroup).downloadAsync(),
    ];
  }
}
github clintmod / login-example-react-native-expo-react-navigation-mobx-nativebase-typescript / src / components / images / Images.ts View on Github external
public static downloadAsync(): Array> {
    return [
      Asset.fromModule(Images.login).downloadAsync(),
      Asset.fromModule(Images.signUp).downloadAsync(),
      Asset.fromModule(Images.drawer).downloadAsync(),
      Asset.fromModule(Images.home).downloadAsync(),
      Asset.fromModule(Images.lists).downloadAsync(),
      Asset.fromModule(Images.timeline).downloadAsync(),

      Asset.fromModule(Images.defaultAvatar).downloadAsync(),
      Asset.fromModule(Images.avatar1).downloadAsync(),
      Asset.fromModule(Images.avatar2).downloadAsync(),
      Asset.fromModule(Images.avatar3).downloadAsync(),

      Asset.fromModule(Images.foodGroup).downloadAsync(),
      Asset.fromModule(Images.workGroup).downloadAsync(),
      Asset.fromModule(Images.vacationGroup).downloadAsync(),
      Asset.fromModule(Images.citiesGroup).downloadAsync(),
    ];
  }
}
github leethree / WineGlass / App.js View on Github external
    imageAssets.map(image => Asset.fromModule(image).downloadAsync()),
  );