0
0
React Nativemobile~10 mins

Over-the-air updates (EAS Update) in React Native - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the EAS Update module in a React Native app.

React Native
import [1] from 'expo-updates';
Drag options to blanks, or click blank then click option'
AUpdates
BExpoUpdates
CEASUpdate
DUpdateManager
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect module names like 'EASUpdate' or 'ExpoUpdates'.
Trying to import from a wrong package.
2fill in blank
medium

Complete the code to check if a new update is available using EAS Update.

React Native
const update = await Updates.[1]();
Drag options to blanks, or click blank then click option'
AfetchUpdate
BcheckForUpdate
CcheckForUpdateAsync
DgetUpdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method without 'Async' suffix.
Using a method name that does not exist.
3fill in blank
hard

Fix the error in the code to reload the app after an update is downloaded.

React Native
if (update.isAvailable) {
  await Updates.fetchUpdateAsync();
  await Updates.[1]();
}
Drag options to blanks, or click blank then click option'
AreloadAsync
Breload
Crestart
DreloadApp
Attempts:
3 left
💡 Hint
Common Mistakes
Using synchronous reload methods that do not exist.
Calling reload without awaiting the update download.
4fill in blank
hard

Fill both blanks to create a function that checks for updates and reloads the app if an update is available.

React Native
async function checkAndUpdate() {
  const update = await Updates.[1]();
  if (update.[2]) {
    await Updates.fetchUpdateAsync();
    await Updates.reloadAsync();
  }
}
Drag options to blanks, or click blank then click option'
AcheckForUpdateAsync
BisAvailable
ChasUpdate
DfetchUpdateAsync
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect method names for checking updates.
Using wrong property names to check update availability.
5fill in blank
hard

Fill all three blanks to implement a complete update check, fetch, and reload sequence.

React Native
async function performUpdate() {
  const update = await Updates.[1]();
  if (update.[2]) {
    await Updates.[3]();
    await Updates.reloadAsync();
  }
}
Drag options to blanks, or click blank then click option'
AcheckForUpdateAsync
BisAvailable
CreloadAsync
DfetchUpdateAsync
Attempts:
3 left
💡 Hint
Common Mistakes
Skipping the fetch update step before reloading.
Using wrong method names for fetching or reloading.