Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions apps/native-component-list/src/screens/UI/ModifiersScreen.ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
Switch,
Rectangle,
Slider,
Capsule,
Stepper,
} from '@expo/ui/swift-ui';
import {
background,
Expand All @@ -23,6 +25,7 @@ import {
brightness,
saturation,
scaleEffect,
containerRelativeFrame,
rotationEffect,
offset,
listRowSeparator,
Expand Down Expand Up @@ -107,6 +110,8 @@ export default function ModifiersScreen() {
const badgeType = ['standard', 'increased', 'decreased'] as const;
const [badgeIndex, setBadgeIndex] = useState(0);

const [containerRelativeFrameCount, setContainerRelativeFrameCount] = useState(1);

return (
<ScrollView>
<Host matchContents>
Expand Down Expand Up @@ -631,6 +636,40 @@ export default function ModifiersScreen() {
</VStack>
</Section>

{/* Container Relative Frame Modifier */}
<Section title="Container Relative Frame Modifier">
<Capsule
modifiers={[
containerRelativeFrame({
axes: 'horizontal',
count: containerRelativeFrameCount,
span: 1,
}),
foregroundStyle('#3498DB'),
]}
/>
<HStack>
{new Array(containerRelativeFrameCount).fill(null).map((_, i) => (
<Capsule
key={i}
modifiers={[
containerRelativeFrame({
axes: 'horizontal',
count: containerRelativeFrameCount,
span: 1,
}),
foregroundStyle('#3498DB'),
]}
/>
))}
</HStack>
<Stepper
onValueChanged={setContainerRelativeFrameCount}
defaultValue={containerRelativeFrameCount}
label={`Items count: ${containerRelativeFrameCount}`}
/>
</Section>

<AppearSection />

<Section title="Misc">
Expand Down
9 changes: 8 additions & 1 deletion apps/router-e2e/__e2e__/native-navigation/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ import { Stack, unstable_navigationEvents } from 'expo-router';

const appStart = Date.now();

unstable_navigationEvents.enable();
(['pageWillRender', 'pageFocused', 'pageBlurred', 'pageRemoved'] as const).forEach((eventType) => {
unstable_navigationEvents.addListener(eventType, (event) => {
console.log(`[${Date.now() - appStart}ms] ${eventType}:`, event.pathname, event.screenId);
console.log(
`[${Date.now() - appStart}ms] ${eventType}:`,
event.pathname,
event.params,
event.screenId
);
});
});
unstable_navigationEvents.saveCurrentPathname();

export default function Layout() {
return <Stack screenOptions={{ headerShown: false }} />;
Expand Down
11 changes: 10 additions & 1 deletion apps/router-e2e/__e2e__/native-navigation/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { Link, usePathname, type Href } from 'expo-router';
import React from 'react';
import React, { useEffect } from 'react';
import { Text, Pressable, ScrollView, View } from 'react-native';

const HomeIndex = () => {
const pathname = usePathname();

useEffect(() => {
console.log(
'globalThis.expo.router',
globalThis.expo?.router?.currentPathname,
globalThis.expo?.router?.currentParams
);
}, []);

return (
<ScrollView
style={{ flex: 1, backgroundColor: '#fff' }}
Expand All @@ -18,6 +26,7 @@ const HomeIndex = () => {
<CaseLink href="/toolbar" text="Toolbar" />
<CaseLink href="/header-items" text="Header Items" />
<CaseLink href="/modals" text="Modals" />
<CaseLink href="/params" text="Params" />
</ScrollView>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useLocalSearchParams } from 'expo-router';
import { useEffect } from 'react';
import { Text, View } from 'react-native';

export default function Screen() {
const params = useLocalSearchParams();
useEffect(() => {
console.log(
'globalThis.expo.router',
globalThis.expo?.router?.currentPathname,
globalThis.expo?.router?.currentParams
);
}, []);
return (
<View style={{ flex: 1, justifyContent: 'space-between', alignItems: 'center' }}>
<Text>Nested Param: {JSON.stringify(params)}</Text>
</View>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useLocalSearchParams } from 'expo-router';
import { useEffect } from 'react';
import { Text, View } from 'react-native';

export default function Screen() {
const params = useLocalSearchParams();
useEffect(() => {
console.log(
'globalThis.expo.router',
globalThis.expo?.router?.currentPathname,
globalThis.expo?.router?.currentParams
);
}, []);
return (
<View style={{ flex: 1, justifyContent: 'space-between', alignItems: 'center' }}>
<Text>Param: {JSON.stringify(params)}</Text>
</View>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Stack } from 'expo-router';

export default function Layout() {
return <Stack />;
}
48 changes: 48 additions & 0 deletions apps/router-e2e/__e2e__/native-navigation/app/params/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Link, usePathname, type Href } from 'expo-router';
import React, { useEffect } from 'react';
import { Text, Pressable, ScrollView, View } from 'react-native';

const HomeIndex = () => {
const pathname = usePathname();
useEffect(() => {
console.log(
'globalThis.expo.router',
globalThis.expo?.router?.currentPathname,
globalThis.expo?.router?.currentParams
);
}, []);

return (
<ScrollView
style={{ flex: 1, backgroundColor: '#fff' }}
contentContainerStyle={{ alignItems: 'center', gap: 16 }}
contentInsetAdjustmentBehavior="automatic">
<View>
<Text>Params</Text>
<Text>Current Path: {pathname}</Text>
</View>
<CaseLink href="/params/123" text="/params/123" />
<CaseLink href="/params/123?a=x&b=0" text="/params/123?a=x&b=0" />
<CaseLink
href={{
pathname: '/params/[path]',
params: { a: 'x', b: '0', path: '123' },
}}
text="/params/123?a=x&b=0 object"
/>
<CaseLink href="/params/456/aaa?x=1&y=2" text="/params/456/aaa?x=1&y=2" />
</ScrollView>
);
};

function CaseLink({ href, text }: { href: Href; text: string }) {
return (
<Link href={href} asChild>
<Pressable style={{ backgroundColor: 'rgb(11, 103, 175)', padding: 16, borderRadius: 8 }}>
<Text style={{ color: '#fff' }}>{text}</Text>
</Pressable>
</Link>
);
}

export default HomeIndex;
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ extension ExpoSwiftUI {
open class ViewProps: ObservableObject, Record {
public required init() {}

public required init(rawProps: [String: Any], context: AppContext) throws {
appContext = context
try updateRawProps(rawProps, appContext: context)
}

/**
An array of views passed by React as children.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/expo-router/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
- [ios] remove unstable_splitView and enable split view by default ([#42128](https://github.com/expo/expo/pull/42128) by [@Ubax](https://github.com/Ubax))
- [iOS] reduce number of times UIBarButtonItem is recreated ([#41900](https://github.com/expo/expo/pull/41900) by [@Ubax](https://github.com/Ubax))
- [ios] add comment to ENV['RNS_GAMMA_ENABLED'] set by config plugin ([#42231](https://github.com/expo/expo/pull/42231) by [@Ubax](https://github.com/Ubax))
- add `unstable_navigationEvents` to `globalThis.expo` ([#42238](https://github.com/expo/expo/pull/42238) by [@Ubax](https://github.com/Ubax))

## 6.0.17 - 2025-12-05

Expand Down
29 changes: 29 additions & 0 deletions packages/expo-router/build/global.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/expo-router/build/global.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/expo-router/build/global.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/expo-router/build/global.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/expo-router/build/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-router/build/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/expo-router/build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-router/build/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 7 additions & 24 deletions packages/expo-router/build/navigationEvents/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-router/build/navigationEvents/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading