Knit UI
GitHub

Upgrading to Knit UI 1.1 (Expo SDK 58)

Knit UI 1.1 is the kit on Expo SDK 58. The component API and the styling language from 1.0 are unchanged, but the kit's peer dependencies now require SDK 58, so an app on SDK 57 has to upgrade Expo with it. One API changed as well: Carousel's gestureConfig (see below).

The short version

  1. Upgrade your app to Expo SDK 58 (npx expo install expo@^58 and then npx expo install --fix).
  2. Bump every @knitui/* package together: core, hooks, mediaquery, components, icons, emoji, graphics, dates, media, carousel and sheet go to 1.1, map to 0.6 and plugins to 1.0.1.
  3. On iOS, apply the build patches below (or build React Native from source).
  4. If you pass gestureConfig to a Carousel, switch it to the config object.

What you need to change

Expo SDK 58 is required

DependencyVersion
react-native0.88
react19.3
react-native-reanimated4.7
react-native-worklets0.13
react-native-gesture-handler3.3
@shopify/react-native-skia2.14
react-native-svg15.16
expo-image~58.0
expo-audio / expo-video~58.0

Every kit gesture now uses the Gesture Handler 3 hook API, so the carousel can no longer hand you a Gesture.Pan() builder to modify.

// before (1.0)
<Carousel gestureConfig={(g) => g.activeOffsetX([-10, 10]).simultaneousWithExternalGesture(other)} />

// after (1.1)
<Carousel gestureConfig={{ activeOffsetX: [-10, 10], simultaneousWith: other }} />

The object is typed as CarouselGestureConfig.

Native ref types

React Native 0.88's generated types are stricter: component values are no longer instance types. The kit's native refs now use ScrollViewInstance and ViewInstance (for example EffectView's ref and KeyboardAwareScrollView's forwarded ref). Type your own refs the same way if tsc complains.

iOS build patches

React Native 0.88 builds React from a precompiled framework by default. Two dependencies and React Native itself need a small patch until their fixes ship. Apply them with a pnpm or patch-package patch, or set ios.buildReactNativeFromSource to true instead.

  • react-native-teleport@1.2.2 (used by Portal) and @maplibre/maplibre-react-native@11.5.0 don't compile: they import "RCTFabricComponentsPlugins.h". Change it to <React/RCTFabricComponentsPlugins.h>.
  • react-native@0.88.0 lists its sample SampleTurboModule as a module to set up at startup, but the precompiled framework doesn't include it, so every debug launch shows an "Unable to find module for SampleTurboModule" red box. Remove that entry from codegenConfig.libraries[0].ios.modules in react-native/package.json, then run pod install.

New in this release and optional: pass your navigator's focus state to <Provider useScreenFocus>. A stack navigator keeps the screen you left mounted, and without this an open popover there draws over the screen in front. See Overlays in a navigation stack for the Expo Router hook.

Fixed in 1.1

  • Audio, Video, AudioPlaylist and AudioRecorder no longer crash on React Native 0.88.
  • AudioMesh no longer crashes native apps on Skia 2.14.
  • @knitui/media no longer crashes web apps without the expo entry (such as Next) on SDK 58.
  • react-native-svg works on the web again through @knitui/plugins/next-plugin.
  • No more "Dependencies should only be used on the web" warnings from kit components.
  • variant="gradient" without a gradient prop paints the theme gradient, as documented.

Reference

Edit this page on GitHub