Skip to content

Expo SDK 33 adds beta web support, TypeScript definitions and React hooks

updated

Expo has released SDK v33.0.0, based on React Native 0.59.8 (up from 0.57.1 in SDK 32) and React 16.8.3, which brings hooks to Expo projects. It is also the first Expo SDK with beta web support.

Web support in beta

Expo template projects now include web support out of the box, powered by react-native-web, making projects tri-platform across iOS, Android and web. Many SDK modules include built-in web support. The team notes the feature is still in beta and may not produce a production-ready website right away. To try it:

$ npm install -g expo-cli
$ expo init web-test-project && cd web-test-project
$ expo start -w

Modular imports and TypeScript

Importing most modules from the expo package is now deprecated. Instead of import { FileSystem } from 'expo';, developers install individual packages with the new expo install command, which picks a version compatible with the project's SDK, e.g. expo install expo-file-system followed by import * as FileSystem from 'expo-file-system';. Old imports still work in SDK 33 but log a warning, and a codemod (expo-codemod) can update them automatically. The change paves the way for tree-shaking and simplifies moving between managed and bare workflows.

All Expo-authored modules are now written in TypeScript and ship .d.ts files, so @types/expo is no longer needed. A new blank (TypeScript) template with App.tsx and tsconfig.json is available via expo init.

Hooks support also enables new APIs such as useKeepAwake, which releases its lock automatically when the component unmounts.

Custom iOS clients and background location

With a paid Apple Developer account, expo client:ios builds a custom Expo client using ad-hoc provisioning. The custom client is meant for development and testing. It includes features that had been Android-only, such as the QR code scanner, and also Background Location, which had to be removed from the App Store version of the Expo client to comply with App Store guidelines.

New and revised APIs

SDK 33 adds Crypto, Random, Sharing and VideoThumbnails. Haptics and BackgroundFetch now work on Android. Brightness, ScreenOrientation, KeepAwake and WebView were rewritten with revised APIs; WebView now uses react-native-webview. Library updates include react-native-gesture-handler 1.2.1, react-native-reanimated 1.0.1, react-native-maps 0.24.2 and react-native-svg 9.4.0, plus the addition of @react-native-community/netinfo.

Breaking changes and support

Notable breaking changes include swapped cover/contain splash resizeMode behavior on Android standalone apps, Haptic renamed to Haptics, IntentLauncherAndroid renamed to IntentLauncher, and removal of the devKernel and prodKernel flavors from Android ExpoKit projects. The Bare workflow has also improved, with easier unimodule installation on Android and use_frameworks! support.

SDKs 26 through 30 no longer run in the latest Expo client, though existing standalone apps keep working. Expo recommends Android developers upgrade now to prepare for 64-bit APKs coming in SDK 34, which Google Play will require starting in August. At release time, expo build:ios and expo build:android were not yet available for SDK 33 projects.

To upgrade, set sdkVersion to "33.0.0" in app.json, update react-native, expo and react (exactly "16.8.3") in package.json, reinstall node_modules, and run expo start -c.

Source: web.archive.org