From 870dcba2ade9572fc279f0a47bfbdd78af4a236d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nishan=20=28o=5E=E2=96=BD=5Eo=29?= Date: Fri, 1 May 2026 10:27:53 +0530 Subject: [PATCH] [ui][compose] Extend Expo UI with custom Compose views and modifiers guide and example (#45122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Why We want an ability to extend Expo UI with custom Compose views and modifiers. This PR adds related APIs, examples and guide for the same. # How - Added `unregister` method to `ModifierRegistry` to unregister to modifier, similar to iOS - Exported `createModifier`, `createViewModifierEventListener` - Added example in NCL - Added a documentation guide. # Test Plan Test Extend Expo UI example in NCL Expo UI screen. Screenshot 2026-04-27 at 6 19 28 PM # Checklist - [x] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [x] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Aman Mittal --- .../modules/test-expo-ui/android/build.gradle | 47 +++ .../testexpoui/CustomBorderModifier.kt | 26 ++ .../expo/modules/testexpoui/MyCustomView.kt | 33 ++ .../modules/testexpoui/TestExpoUiModule.kt | 29 ++ .../test-expo-ui/expo-module.config.json | 5 +- .../test-expo-ui/src/MyCustomView.android.tsx | 20 + .../test-expo-ui/src/modifiers.android.ts | 8 + .../UI/ExtendingExpoUIScreen.android.tsx | 35 ++ .../src/screens/UI/UIScreen.android.tsx | 8 + docs/constants/navigation.js | 1 + .../expo-ui-jetpack-compose/extending.mdx | 353 ++++++++++++++++++ packages/expo-ui/CHANGELOG.md | 1 + .../java/expo/modules/ui/ModifierRegistry.kt | 8 + .../expo-ui/build/jetpack-compose/index.d.ts | 1 + .../build/jetpack-compose/index.d.ts.map | 2 +- .../jetpack-compose/modifiers/index.d.ts | 2 + .../jetpack-compose/modifiers/index.d.ts.map | 2 +- packages/expo-ui/src/jetpack-compose/index.ts | 1 + .../src/jetpack-compose/modifiers/index.ts | 3 + 19 files changed, 582 insertions(+), 3 deletions(-) create mode 100644 apps/bare-expo/modules/test-expo-ui/android/build.gradle create mode 100644 apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/CustomBorderModifier.kt create mode 100644 apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/MyCustomView.kt create mode 100644 apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/TestExpoUiModule.kt create mode 100644 apps/bare-expo/modules/test-expo-ui/src/MyCustomView.android.tsx create mode 100644 apps/bare-expo/modules/test-expo-ui/src/modifiers.android.ts create mode 100644 apps/native-component-list/src/screens/UI/ExtendingExpoUIScreen.android.tsx create mode 100644 docs/pages/guides/expo-ui-jetpack-compose/extending.mdx diff --git a/apps/bare-expo/modules/test-expo-ui/android/build.gradle b/apps/bare-expo/modules/test-expo-ui/android/build.gradle new file mode 100644 index 00000000000000..13b64ed2e172d0 --- /dev/null +++ b/apps/bare-expo/modules/test-expo-ui/android/build.gradle @@ -0,0 +1,47 @@ +// Added by extending Expo UI: pull in the Kotlin Compose compiler plugin classpath. +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath("org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:${kotlinVersion}") + } +} + +apply plugin: 'com.android.library' +apply plugin: 'expo-module-gradle-plugin' +apply plugin: 'org.jetbrains.kotlin.plugin.compose' // Added by extending Expo UI + +group = 'host.exp.exponent' +version = '0.1.0' + +expoModule { + canBePublished false +} + +android { + namespace "expo.modules.testexpoui" + defaultConfig { + versionCode 1 + versionName "0.1.0" + } + // Added by extending Expo UI: turn on Jetpack Compose for this module. + buildFeatures { + compose true + } + lintOptions { + abortOnError false + } +} + +// Added by extending Expo UI: depend on `expo-ui` plus the Compose libraries we use. +dependencies { + if (findProject(':expo-ui') != null) { + implementation project(':expo-ui') + } else { + implementation 'expo.modules.ui:expo.modules.ui:+' + } + implementation 'androidx.compose.foundation:foundation-android:1.10.6' + implementation 'androidx.compose.ui:ui-android:1.10.6' + implementation 'androidx.compose.material3:material3:1.5.0-alpha17' +} diff --git a/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/CustomBorderModifier.kt b/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/CustomBorderModifier.kt new file mode 100644 index 00000000000000..99c2dac94d8d8c --- /dev/null +++ b/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/CustomBorderModifier.kt @@ -0,0 +1,26 @@ +package expo.modules.testexpoui + +import android.graphics.Color +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.border +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import expo.modules.kotlin.records.Field +import expo.modules.kotlin.records.Record +import expo.modules.kotlin.types.OptimizedRecord +import expo.modules.ui.compose + +@OptimizedRecord +data class CustomBorderParams( + @Field val color: Color? = null, + @Field val width: Int = 2, + @Field val cornerRadius: Int = 0 +) : Record + +fun customBorderModifier(params: CustomBorderParams): Modifier { + return Modifier.border( + border = BorderStroke(params.width.dp, params.color.compose), + shape = RoundedCornerShape(params.cornerRadius.dp) + ) +} diff --git a/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/MyCustomView.kt b/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/MyCustomView.kt new file mode 100644 index 00000000000000..2ff9b48dd75895 --- /dev/null +++ b/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/MyCustomView.kt @@ -0,0 +1,33 @@ +package expo.modules.testexpoui + +import androidx.compose.foundation.layout.Column +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import expo.modules.kotlin.views.ComposeProps +import expo.modules.kotlin.views.FunctionalComposableScope +import expo.modules.kotlin.views.OptimizedComposeProps +import expo.modules.ui.ModifierList +import expo.modules.ui.ModifierRegistry +import expo.modules.ui.UIComposableScope + +@OptimizedComposeProps +data class MyCustomViewProps( + val title: String = "", + val modifiers: ModifierList = emptyList() +) : ComposeProps + +@Composable +fun FunctionalComposableScope.MyCustomViewContent(props: MyCustomViewProps) { + Column( + modifier = ModifierRegistry.applyModifiers( + props.modifiers, + appContext, + composableScope, + globalEventDispatcher + ) + ) { + Text(text = props.title, style = MaterialTheme.typography.titleMedium) + Children(UIComposableScope()) + } +} diff --git a/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/TestExpoUiModule.kt b/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/TestExpoUiModule.kt new file mode 100644 index 00000000000000..79f9a749648b35 --- /dev/null +++ b/apps/bare-expo/modules/test-expo-ui/android/src/main/java/expo/modules/testexpoui/TestExpoUiModule.kt @@ -0,0 +1,29 @@ +package expo.modules.testexpoui + +import expo.modules.kotlin.modules.Module +import expo.modules.kotlin.modules.ModuleDefinition +import expo.modules.kotlin.records.recordFromMap +import expo.modules.ui.ExpoUIView +import expo.modules.ui.ModifierRegistry + +class TestExpoUiModule : Module() { + override fun definition() = ModuleDefinition { + Name("TestExpoUi") + + OnCreate { + ModifierRegistry.register("customBorder") { map, _, _, _ -> + customBorderModifier(recordFromMap(map)) + } + } + + OnDestroy { + ModifierRegistry.unregister("customBorder") + } + + ExpoUIView("MyCustomView") { + Content { props -> + MyCustomViewContent(props) + } + } + } +} diff --git a/apps/bare-expo/modules/test-expo-ui/expo-module.config.json b/apps/bare-expo/modules/test-expo-ui/expo-module.config.json index adca158a4d6cb5..a4594b3472b9c0 100644 --- a/apps/bare-expo/modules/test-expo-ui/expo-module.config.json +++ b/apps/bare-expo/modules/test-expo-ui/expo-module.config.json @@ -1,6 +1,9 @@ { - "platforms": ["apple"], + "platforms": ["apple", "android"], "apple": { "modules": ["TestExpoUiModule"] + }, + "android": { + "modules": ["expo.modules.testexpoui.TestExpoUiModule"] } } diff --git a/apps/bare-expo/modules/test-expo-ui/src/MyCustomView.android.tsx b/apps/bare-expo/modules/test-expo-ui/src/MyCustomView.android.tsx new file mode 100644 index 00000000000000..77309344f177fa --- /dev/null +++ b/apps/bare-expo/modules/test-expo-ui/src/MyCustomView.android.tsx @@ -0,0 +1,20 @@ +import { type PrimitiveBaseProps } from '@expo/ui/jetpack-compose'; +import { createViewModifierEventListener } from '@expo/ui/jetpack-compose/modifiers'; +import { requireNativeView } from 'expo'; + +export interface MyCustomViewProps extends PrimitiveBaseProps { + title: string; + children?: React.ReactNode; +} + +const NativeMyCustomView = requireNativeView('TestExpoUi', 'MyCustomView'); + +export function MyCustomView({ modifiers, ...restProps }: MyCustomViewProps) { + return ( + + ); +} diff --git a/apps/bare-expo/modules/test-expo-ui/src/modifiers.android.ts b/apps/bare-expo/modules/test-expo-ui/src/modifiers.android.ts new file mode 100644 index 00000000000000..2f248db83f0924 --- /dev/null +++ b/apps/bare-expo/modules/test-expo-ui/src/modifiers.android.ts @@ -0,0 +1,8 @@ +import { createModifier } from '@expo/ui/jetpack-compose/modifiers'; +import { type ColorValue } from 'react-native'; + +export const customBorder = (params: { + color?: ColorValue; + width?: number; + cornerRadius?: number; +}) => createModifier('customBorder', params); diff --git a/apps/native-component-list/src/screens/UI/ExtendingExpoUIScreen.android.tsx b/apps/native-component-list/src/screens/UI/ExtendingExpoUIScreen.android.tsx new file mode 100644 index 00000000000000..9032304d545251 --- /dev/null +++ b/apps/native-component-list/src/screens/UI/ExtendingExpoUIScreen.android.tsx @@ -0,0 +1,35 @@ +import { Column, Host, Text } from '@expo/ui/jetpack-compose'; +import { background, clip, paddingAll } from '@expo/ui/jetpack-compose/modifiers'; +import { requireNativeModule } from 'expo'; +import { MyCustomView, customBorder } from 'test-expo-ui'; + +let hasTestExpoUiModule = false; +try { + requireNativeModule('TestExpoUi'); + hasTestExpoUiModule = true; +} catch { + hasTestExpoUiModule = false; +} + +export default function ExtendingExpoUIScreen() { + return ( + + + {hasTestExpoUiModule ? ( + + This is a child of MyCustomView + + ) : ( + test-expo-ui module is not available in this environment. + )} + + + ); +} diff --git a/apps/native-component-list/src/screens/UI/UIScreen.android.tsx b/apps/native-component-list/src/screens/UI/UIScreen.android.tsx index b09c9fdd6ea38d..24c8dc40852ab8 100644 --- a/apps/native-component-list/src/screens/UI/UIScreen.android.tsx +++ b/apps/native-component-list/src/screens/UI/UIScreen.android.tsx @@ -354,6 +354,14 @@ export const UIScreens = [ return optionalRequire(() => require('./TooltipScreen')); }, }, + { + name: 'Extending Expo UI', + route: 'ui/extending', + options: {}, + getComponent() { + return optionalRequire(() => require('./ExtendingExpoUIScreen')); + }, + }, ]; export default function UIScreen() { diff --git a/docs/constants/navigation.js b/docs/constants/navigation.js index 9e77da5bce430d..6c1b98bab0e8bb 100644 --- a/docs/constants/navigation.js +++ b/docs/constants/navigation.js @@ -395,6 +395,7 @@ export const general = [ makeSection('Expo UI', [ makePage('guides/expo-ui-swift-ui/index.mdx'), makePage('guides/expo-ui-swift-ui/extending.mdx'), + makePage('guides/expo-ui-jetpack-compose/extending.mdx'), ]), makeSection('Troubleshooting', [ makePage('troubleshooting/overview.mdx'), diff --git a/docs/pages/guides/expo-ui-jetpack-compose/extending.mdx b/docs/pages/guides/expo-ui-jetpack-compose/extending.mdx new file mode 100644 index 00000000000000..c3b8e1d351c76d --- /dev/null +++ b/docs/pages/guides/expo-ui-jetpack-compose/extending.mdx @@ -0,0 +1,353 @@ +--- +title: Extending with Jetpack Compose +sidebar_title: Extending with Jetpack Compose +description: Learn how to create custom Jetpack Compose components and modifiers that integrate with Expo UI. +platforms: ['android'] +--- + +import { Terminal } from '~/ui/components/Snippet'; +import { Step } from '~/ui/components/Step'; + +This guide explains how to create custom Jetpack Compose components and modifiers that integrate seamlessly with Expo UI. + +## Prerequisites + +Before you begin, make sure you have: + +- `@expo/ui` installed in your project. See [Building Jetpack Compose apps with Expo UI](/versions/latest/sdk/ui/jetpack-compose/) for more information. +- A [development build](/develop/development-builds/introduction/) of your app (Expo UI is not available in Expo Go). +- Basic familiarity with [Expo Modules API](/modules/overview/) and [Jetpack Compose](https://developer.android.com/jetpack/compose). + + + +## Creating a custom component + +### Project setup + + + +Create a local Expo module in your project: + + + + + + + +Update your module's **android/build.gradle** to enable Jetpack Compose and depend on `expo-ui`. The lines marked below are added on top of the default scaffold: + +```groovy my-ui/android/build.gradle +// Pull in the Kotlin Compose compiler plugin classpath. +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath("org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:${kotlinVersion}") + } +} + +apply plugin: 'com.android.library' +apply plugin: 'expo-module-gradle-plugin' +apply plugin: 'org.jetbrains.kotlin.plugin.compose' // Apply the Compose compiler plugin. + +// ... group / version + +android { + // ... namespace, defaultConfig + + // Turn on Jetpack Compose for this module. + buildFeatures { + compose true + } +} + +// Depend on `expo-ui` plus the Compose libraries you use. +dependencies { + if (findProject(':expo-ui') != null) { + implementation project(':expo-ui') + } else { + implementation 'expo.modules.ui:expo.modules.ui:+' + } + implementation 'androidx.compose.foundation:foundation-android:1.10.6' + implementation 'androidx.compose.ui:ui-android:1.10.6' + implementation 'androidx.compose.material3:material3:1.5.0-alpha17' +} +``` + + + +### Creating a Compose view + + + +Create your Compose view. It has two parts: + +1. **Props data class**: annotated with `@OptimizedComposeProps`, implements `ComposeProps`, and includes a `modifiers: ModifierList` field for the [`modifiers`](/versions/latest/sdk/ui/jetpack-compose/modifiers/) prop. +2. **`@Composable` content function**: an extension on `FunctionalComposableScope` so it can call `ModifierRegistry.applyModifiers(...)` and render `Children(...)`. + +```kotlin my-ui/android/src/main/java/expo/modules/myui/MyCustomView.kt +package expo.modules.myui + +import androidx.compose.foundation.layout.Column +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import expo.modules.kotlin.views.ComposeProps +import expo.modules.kotlin.views.FunctionalComposableScope +import expo.modules.kotlin.views.OptimizedComposeProps +import expo.modules.ui.ModifierList +import expo.modules.ui.ModifierRegistry +import expo.modules.ui.UIComposableScope + +@OptimizedComposeProps +data class MyCustomViewProps( + val title: String = "", + val modifiers: ModifierList = emptyList() +) : ComposeProps + +@Composable +fun FunctionalComposableScope.MyCustomViewContent(props: MyCustomViewProps) { + Column( + modifier = ModifierRegistry.applyModifiers( + props.modifiers, + appContext, + composableScope, + globalEventDispatcher + ) + ) { + Text(text = props.title, style = MaterialTheme.typography.titleMedium) + Children(UIComposableScope()) // Renders React children + } +} +``` + + + + + +Register the view in your module using `ExpoUIView`. This wires your `@Composable` content into the Expo modules view system and makes it available to JavaScript: + +```kotlin my-ui/android/src/main/java/expo/modules/myui/MyUiModule.kt +package expo.modules.myui + +import expo.modules.kotlin.modules.Module +import expo.modules.kotlin.modules.ModuleDefinition +import expo.modules.ui.ExpoUIView + +class MyUiModule : Module() { + override fun definition() = ModuleDefinition { + Name("MyUi") + + ExpoUIView("MyCustomView") { + Content { props -> + MyCustomViewContent(props) + } + } + } +} +``` + + + + + +Create a wrapper component that connects modifiers with event handling. The `createViewModifierEventListener` utility enables event-based modifiers like `clickable` and `onVisibilityChanged` to work with your custom view: + +```tsx my-ui/src/MyCustomView.tsx +import { type PrimitiveBaseProps } from '@expo/ui/jetpack-compose'; +import { createViewModifierEventListener } from '@expo/ui/jetpack-compose/modifiers'; +import { requireNativeView } from 'expo'; + +export interface MyCustomViewProps extends PrimitiveBaseProps { + title: string; + children?: React.ReactNode; +} + +const NativeMyCustomView = requireNativeView('MyUi', 'MyCustomView'); + +export function MyCustomView({ modifiers, ...restProps }: MyCustomViewProps) { + return ( + + ); +} +``` + + + +### Using your custom component + +Your custom component now works with all `@expo/ui` built-in modifiers: + +```tsx app/index.tsx +import { Host, Text } from '@expo/ui/jetpack-compose'; +import { background, clip, paddingAll } from '@expo/ui/jetpack-compose/modifiers'; +import { MyCustomView } from './modules/my-ui'; + +export default function App() { + return ( + + + Child content + + + ); +} +``` + +## Creating custom modifiers + +You can also create custom modifiers that work with any Expo UI component. + +> **info** Modifiers are Compose's way to configure layouts for styling, sizing, behavior, and more. Learn more in Android's [Compose modifiers documentation](https://developer.android.com/jetpack/compose/modifiers). + +### Native modifier implementation + + + +Define your modifier's parameters as an `@OptimizedRecord` data class, and a function that returns a `Modifier` from those params: + +```kotlin my-ui/android/src/main/java/expo/modules/myui/CustomBorderModifier.kt +package expo.modules.myui + +import android.graphics.Color +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.border +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import expo.modules.kotlin.records.Field +import expo.modules.kotlin.records.Record +import expo.modules.kotlin.types.OptimizedRecord +import expo.modules.ui.compose + +@OptimizedRecord +data class CustomBorderParams( + @Field val color: Color? = null, + @Field val width: Int = 2, + @Field val cornerRadius: Int = 0 +) : Record + +fun customBorderModifier(params: CustomBorderParams): Modifier { + return Modifier.border( + border = BorderStroke(params.width.dp, params.color.compose), + shape = RoundedCornerShape(params.cornerRadius.dp) + ) +} +``` + +`compose` is a Kotlin extension property on `android.graphics.Color?` defined in the `expo.modules.ui` package. Importing it with `import expo.modules.ui.compose` lets you call `params.color.compose` to convert the Android `Color` parsed from JS into the `androidx.compose.ui.graphics.Color` that Compose APIs (like `BorderStroke`) expect. It's the same helper Expo UI's built-in modifiers use. + + + + + +Register your modifier with `ModifierRegistry` in your module definition. Use `OnCreate` to register and `OnDestroy` to unregister so the factory does not leak across module reloads: + +```kotlin my-ui/android/src/main/java/expo/modules/myui/MyUiModule.kt +package expo.modules.myui + +import expo.modules.kotlin.modules.Module +import expo.modules.kotlin.modules.ModuleDefinition +import expo.modules.kotlin.records.recordFromMap +import expo.modules.ui.ExpoUIView +import expo.modules.ui.ModifierRegistry + +class MyUiModule : Module() { + override fun definition() = ModuleDefinition { + Name("MyUi") + + OnCreate { + ModifierRegistry.register("customBorder") { map, _, _, _ -> + customBorderModifier(recordFromMap(map)) + } + } + + OnDestroy { + ModifierRegistry.unregister("customBorder") + } + + ExpoUIView("MyCustomView") { + Content { props -> + MyCustomViewContent(props) + } + } + } +} +``` + +The `register` lambda receives the raw map sent from JavaScript, the current `ComposableScope` (use it for scope-dependent modifiers like `weight` or `align`), the `AppContext`, and an event dispatcher. Most modifiers only need `map` and convert it via `recordFromMap(map)`. + + + +### JavaScript modifier function + + + +Create a TypeScript function that builds the modifier config: + +```ts my-ui/src/modifiers.ts +import { createModifier } from '@expo/ui/jetpack-compose/modifiers'; +import { type ColorValue } from 'react-native'; + +export const customBorder = (params: { + color?: ColorValue; + width?: number; + cornerRadius?: number; +}) => createModifier('customBorder', params); +``` + + + + + +Export the modifier from your module: + +```ts my-ui/index.ts +export { MyCustomView, type MyCustomViewProps } from './src/MyCustomView'; +export { customBorder } from './src/modifiers'; +``` + + + +### Using custom modifiers + +Your custom modifier works with any `@expo/ui` component: + +```tsx app/index.tsx +import { Column, Host, Text } from '@expo/ui/jetpack-compose'; +import { paddingAll } from '@expo/ui/jetpack-compose/modifiers'; +import { customBorder } from './modules/my-ui'; + +export default function App() { + return ( + + + This has a custom border! + + + ); +} +``` + +## Next steps + +Congratulations! You've learned how to extend Expo UI with custom Jetpack Compose components and modifiers. Your custom components now integrate seamlessly with the built-in modifier system. + +Here are some ideas for what to build next: + +- Use the [built-in Jetpack Compose components](/versions/latest/sdk/ui/jetpack-compose/) that come with Expo UI. +- Build custom modifiers for app-specific styling patterns. +- Wrap third-party Compose libraries for use in React Native. +- Share your components as an npm package for others to use. diff --git a/packages/expo-ui/CHANGELOG.md b/packages/expo-ui/CHANGELOG.md index 23b311ea0fbca1..8a86566348b1c3 100644 --- a/packages/expo-ui/CHANGELOG.md +++ b/packages/expo-ui/CHANGELOG.md @@ -36,6 +36,7 @@ ### 🎉 New features +- [compose] Exposed extension utilities for third-party modules: `ModifierRegistry.unregister`, and re-exported `createModifier` / `createModifierWithEventListener` / `createViewModifierEventListener` from `@expo/ui/jetpack-compose/modifiers`. Exported `PrimitiveBaseProps` from `@expo/ui/jetpack-compose`. ([#45122](https://github.com/expo/expo/pull/45122) by [@nishan](https://github.com/intergalacticspacehighway)) - [android] Add `colors` prop to `HorizontalFloatingToolbar` to override the variant's default toolbar and FAB container/content colors. ([#45244](https://github.com/expo/expo/pull/45244) by [@Ubax](https://github.com/Ubax)) - [android] Added `HorizontalPager` component wrapping Compose's `HorizontalPager`. ([#45163](https://github.com/expo/expo/pull/45163) by [@vonovak](https://github.com/vonovak)) - [compose] Added worklet and `ObservableState` support to `TextField`. Added `value` prop accepting `ObservableState` (create via `useNativeState`). `onValueChange` now supports worklets for synchronous UI-thread updates. Added `TextFieldValue` type with `text` + `selection` for worklet-driven caret control. Replaced `defaultValue`, callers pass state via `useNativeState` or omit for an empty field. ([#45024](https://github.com/expo/expo/pull/45024) by [@nishan](https://github.com/intergalacticspacehighway)) diff --git a/packages/expo-ui/android/src/main/java/expo/modules/ui/ModifierRegistry.kt b/packages/expo-ui/android/src/main/java/expo/modules/ui/ModifierRegistry.kt index db7db4640ba15f..6876aaef4c7e4f 100644 --- a/packages/expo-ui/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +++ b/packages/expo-ui/android/src/main/java/expo/modules/ui/ModifierRegistry.kt @@ -328,6 +328,14 @@ object ModifierRegistry { modifierFactories[type] = factory } + /** + * Unregisters a previously registered modifier. Pair with `register` from + * `OnCreate` / `OnDestroy` to avoid leaking factories between module reloads. + */ + fun unregister(type: String) { + modifierFactories.remove(type) + } + /** * Applies an array of modifier configs to build a Compose Modifier chain. */ diff --git a/packages/expo-ui/build/jetpack-compose/index.d.ts b/packages/expo-ui/build/jetpack-compose/index.d.ts index 31f64c208a79f5..6809acf25b4cf7 100644 --- a/packages/expo-ui/build/jetpack-compose/index.d.ts +++ b/packages/expo-ui/build/jetpack-compose/index.d.ts @@ -48,4 +48,5 @@ export * from './Column'; export * from './FlowRow'; export { useNativeState } from '../State/useNativeState'; export type { ViewEvent } from '../types'; +export type { PrimitiveBaseProps } from './layout-types'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/expo-ui/build/jetpack-compose/index.d.ts.map b/packages/expo-ui/build/jetpack-compose/index.d.ts.map index f6eab261d3b8ba..73089bfa30c5b8 100644 --- a/packages/expo-ui/build/jetpack-compose/index.d.ts.map +++ b/packages/expo-ui/build/jetpack-compose/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/jetpack-compose/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uCAAuC,CAAC;AAE/C,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAA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C;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9C,cAAc,WAAW,CAAC;AAE1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts b/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts index b56bc8943a21e2..aec52508d1b893 100644 --- a/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts +++ b/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts @@ -327,4 +327,6 @@ export declare const verticalScroll: () => import("./createModifier").ModifierCo * Use on a Row to create a non-lazy scrollable container. */ export declare const horizontalScroll: () => import("./createModifier").ModifierConfig; +export { createModifier, createModifierWithEventListener } from './createModifier'; +export { createViewModifierEventListener } from './utils'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts.map b/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts.map index 824205cee9e76c..faa4d5cab43a78 100644 --- a/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts.map +++ b/packages/expo-ui/build/jetpack-compose/modifiers/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/modifiers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAEjB,UAAU,GACV,WAAW,GACX,QAAQ,GACR,aAAa,GACb,QAAQ,GACR,WAAW,GACX,aAAa,GACb,cAAc,GACd,WAAW,GAEX,KAAK,GACL,kBAAkB,GAClB,QAAQ,GAER,OAAO,GACP,oBAAoB,GACpB,KAAK,CAAC;AAEV;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,8CAA0C,CAAC;AAEjF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,QAAQ,MAAM,8CACvB,CAAC;AAMzD;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,8CAA8C,CAAC;AAEjG;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,WAAW,MAAM,8CA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AAO,YAAY,8CAAsC,CAAC;AAM/E;;;;GAIG;AACH,eAAO,MAAM,cAAc,iDAAyC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,iDAA2C,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/modifiers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,EACJ,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAEjB,UAAU,GACV,WAAW,GACX,QAAQ,GACR,aAAa,GACb,QAAQ,GACR,WAAW,GACX,aAAa,GACb,cAAc,GACd,WAAW,GAEX,KAAK,GACL,kBAAkB,GAClB,QAAQ,GAER,OAAO,GACP,oBAAoB,GACpB,KAAK,CAAC;AAEV;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,8CAA0C,CAAC;AAEjF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,QAAQ,MAAM,8CACvB,CAAC;AAMzD;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,EAAE,QAAQ,MAAM,8CAA8C,CAAC;AAEjG;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,WAAW,MAAM,8CAAgD,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,8CAAiD,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,WAAW,MAAM,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zE,OAAO,EAAE,cAAc,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC"} \ No newline at end of file diff --git a/packages/expo-ui/src/jetpack-compose/index.ts b/packages/expo-ui/src/jetpack-compose/index.ts index b49f4154e41f56..b9f5da9ea62683 100644 --- a/packages/expo-ui/src/jetpack-compose/index.ts +++ b/packages/expo-ui/src/jetpack-compose/index.ts @@ -50,3 +50,4 @@ export * from './Column'; export * from './FlowRow'; export { useNativeState } from '../State/useNativeState'; export type { ViewEvent } from '../types'; +export type { PrimitiveBaseProps } from './layout-types'; diff --git a/packages/expo-ui/src/jetpack-compose/modifiers/index.ts b/packages/expo-ui/src/jetpack-compose/modifiers/index.ts index 9d3cc6a55b2f12..97a5a031cad2e5 100644 --- a/packages/expo-ui/src/jetpack-compose/modifiers/index.ts +++ b/packages/expo-ui/src/jetpack-compose/modifiers/index.ts @@ -497,3 +497,6 @@ export const verticalScroll = () => createModifier('verticalScroll'); * Use on a Row to create a non-lazy scrollable container. */ export const horizontalScroll = () => createModifier('horizontalScroll'); + +export { createModifier, createModifierWithEventListener } from './createModifier'; +export { createViewModifierEventListener } from './utils';