Most of One’s native modules keep the API shape of the package they replace, so migrating is usually an import change plus the renames below. Options that a table does not list have no One equivalent.
// beforeimport * as Clipboard from 'expo-clipboard'await Clipboard.setStringAsync(text)
// afterimport { One } from 'one'await One.Clipboard.setString(text)From expo-clipboard. See Clipboard.
| expo-clipboard | One |
|---|---|
getStringAsync() | One.Clipboard.getString() |
setStringAsync(text) | One.Clipboard.setString(text) |
hasStringAsync() | One.Clipboard.hasString() |
From expo-network. Import useNetworkState directly from one. See Network.
| expo-network | One |
|---|---|
getNetworkStateAsync() | One.Network.getState() |
addNetworkStateListener(fn) | One.Network.addStateListener(fn) |
useNetworkState() | useNetworkState() |
NetworkStateType.WIFI | 'wifi' (and likewise for every member) |
From expo-web-browser. See Browser.
| expo-web-browser | One |
|---|---|
openBrowserAsync(url, options?) | One.Browser.open(url, options?) |
dismissBrowser() | One.Browser.dismiss() |
openAuthSessionAsync(url, redirectUrl?, options?) | One.Browser.openAuthSession(url, redirectUrl?, options?) |
dismissAuthSession() | One.Browser.dismissAuthSession() |
WebBrowserResult | BrowserResult |
WebBrowserResultType | BrowserResultType |
WebBrowserPresentationStyle | BrowserPresentationStyle |
ERR_WEB_BROWSER_BLOCKED | E_BROWSER_BLOCKED |
From expo-secure-store. See SecureStore.
| expo-secure-store | One |
|---|---|
getItemAsync(key) | One.SecureStore.getItem(key) |
setItemAsync(key, value) | One.SecureStore.setItem(key, value) |
deleteItemAsync(key) | One.SecureStore.deleteItem(key) |
getItem(key) | One.SecureStore.getItemSync(key) |
setItem(key, value) | One.SecureStore.setItemSync(key, value) |
From expo-image-picker. See ImagePicker.
| expo-image-picker | One |
|---|---|
launchImageLibraryAsync | One.ImagePicker.launchLibrary |
launchCameraAsync | One.ImagePicker.launchCamera |
getCameraPermissionsAsync | One.ImagePicker.getCameraPermissions |
requestCameraPermissionsAsync | One.ImagePicker.requestCameraPermissions |
mediaTypes and selectionLimit are the whole options surface;
allowsEditing, quality, aspect, and the rest have no equivalent.
From expo-document-picker. See DocumentPicker.
| expo-document-picker | One |
|---|---|
getDocumentAsync | One.DocumentPicker.getDocument |
copyToCacheDirectory has no equivalent because files are always copied.
Reads through expo-file-system become fetch(uri).
From expo-notifications. See Notifications.
Payload, permission, and push token shapes are the same. Platform enums
become string unions, and channel importance still accepts the numbers 0 to 5.
From react-native-maps. See Map.
Convert the region to a camera: zoom = log2(360 * widthPt / 256 / longitudeDelta),
where widthPt is the map view width in points, and center coordinates as-is.
Marker children become the markers array, and onRegionChangeComplete
becomes onCameraMove. Designs that need custom pin views, callouts, or
camera refs have no equivalent yet; keep react-native-maps for those screens.
From expo-splash-screen. one prebuild keeps the launch screen (the iOS
storyboard, the Android splash) up until React Native draws its first content.
Expo-prebuilt apps get the same hold by dropping expo-splash-screen and
passing holdLaunchScreen: true to vxrn/expo-plugin. To keep it up beyond
the first content, call One.LaunchScreen.preventAutoHide() while modules
evaluate, then One.LaunchScreen.hide() when the app is ready. See
Launch screen.
Expo apps keep Expo prebuild with the vxrn/expo-plugin adapter. Apps
without Expo use one prebuild from native.app. See
Build or Run iOS and Ship with EAS.
Edit this page on GitHub.