From 0ff2687eb6f8576c5013c9731feac97589a85859 Mon Sep 17 00:00:00 2001 From: khethelogp Date: Thu, 26 Mar 2026 21:45:18 +0200 Subject: [PATCH 1/2] Update footer copyright year to current year --- src/pages/home/Footer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/Footer.tsx b/src/pages/home/Footer.tsx index 805b512d24e..452a6cdb804 100644 --- a/src/pages/home/Footer.tsx +++ b/src/pages/home/Footer.tsx @@ -12,7 +12,7 @@ export default function Footer() {
- Copyright © 2024 React Navigation. Built with{' '} + Copyright © {new Date().getFullYear()} React Navigation. Built with{' '} {links.map((link, index) => ( {index > 0 && ', '} From a0bb33de976ffd412db86697a370af24699004ca Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 19:50:09 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- .../rehype-static-to-dynamic.test.ts | 72 ++++++++----------- src/plugins/rehype-static-to-dynamic.ts | 22 +++--- 2 files changed, 44 insertions(+), 50 deletions(-) diff --git a/src/__tests__/rehype-static-to-dynamic.test.ts b/src/__tests__/rehype-static-to-dynamic.test.ts index f5d99f0d31a..a4650e2e095 100644 --- a/src/__tests__/rehype-static-to-dynamic.test.ts +++ b/src/__tests__/rehype-static-to-dynamic.test.ts @@ -1068,9 +1068,7 @@ describe('rehype-static-to-dynamic', () => { assert.strictEqual(output, expected); }); - test( - 'navigator with `.with(...)` merges screenOptions and screenListeners from plain objects', - async () => { + test('navigator with `.with(...)` merges screenOptions and screenListeners from plain objects', async () => { const input = dedent /* javascript */ ` import { useWindowDimensions } from 'react-native'; import { createDrawerNavigator } from '@react-navigation/drawer'; @@ -1155,14 +1153,11 @@ describe('rehype-static-to-dynamic', () => { } `; - assert.strictEqual(output, expected); - } - ); + assert.strictEqual(output, expected); + }); - test( - 'navigator with `.with(...)` merges static objects with wrapper functions', - async () => { - const input = dedent /* javascript */ ` + test('navigator with `.with(...)` merges static objects with wrapper functions', async () => { + const input = dedent /* javascript */ ` import { createDrawerNavigator } from '@react-navigation/drawer'; import { createStaticNavigation } from '@react-navigation/native'; @@ -1196,13 +1191,13 @@ describe('rehype-static-to-dynamic', () => { } `; - const tree = createTestTree(input); - const plugin = rehypeStaticToDynamic(); - await plugin(tree); + const tree = createTestTree(input); + const plugin = rehypeStaticToDynamic(); + await plugin(tree); - const output = extractTransformedCode(tree); + const output = extractTransformedCode(tree); - const expected = dedent /* javascript */ ` + const expected = dedent /* javascript */ ` import { createDrawerNavigator } from '@react-navigation/drawer'; import { NavigationContainer } from '@react-navigation/native'; @@ -1234,14 +1229,11 @@ describe('rehype-static-to-dynamic', () => { } `; - assert.strictEqual(output, expected); - } - ); + assert.strictEqual(output, expected); + }); - test( - 'navigator with `.with(...)` merges static functions with wrapper objects', - async () => { - const input = dedent /* javascript */ ` + test('navigator with `.with(...)` merges static functions with wrapper objects', async () => { + const input = dedent /* javascript */ ` import { createDrawerNavigator } from '@react-navigation/drawer'; import { createStaticNavigation } from '@react-navigation/native'; @@ -1275,13 +1267,13 @@ describe('rehype-static-to-dynamic', () => { } `; - const tree = createTestTree(input); - const plugin = rehypeStaticToDynamic(); - await plugin(tree); + const tree = createTestTree(input); + const plugin = rehypeStaticToDynamic(); + await plugin(tree); - const output = extractTransformedCode(tree); + const output = extractTransformedCode(tree); - const expected = dedent /* javascript */ ` + const expected = dedent /* javascript */ ` import { createDrawerNavigator } from '@react-navigation/drawer'; import { NavigationContainer } from '@react-navigation/native'; @@ -1313,14 +1305,11 @@ describe('rehype-static-to-dynamic', () => { } `; - assert.strictEqual(output, expected); - } - ); + assert.strictEqual(output, expected); + }); - test( - 'navigator with `.with(...)` merges screenOptions and screenListeners when both are functions', - async () => { - const input = dedent /* javascript */ ` + test('navigator with `.with(...)` merges screenOptions and screenListeners when both are functions', async () => { + const input = dedent /* javascript */ ` import { createDrawerNavigator } from '@react-navigation/drawer'; import { createStaticNavigation } from '@react-navigation/native'; @@ -1354,13 +1343,13 @@ describe('rehype-static-to-dynamic', () => { } `; - const tree = createTestTree(input); - const plugin = rehypeStaticToDynamic(); - await plugin(tree); + const tree = createTestTree(input); + const plugin = rehypeStaticToDynamic(); + await plugin(tree); - const output = extractTransformedCode(tree); + const output = extractTransformedCode(tree); - const expected = dedent /* javascript */ ` + const expected = dedent /* javascript */ ` import { createDrawerNavigator } from '@react-navigation/drawer'; import { NavigationContainer } from '@react-navigation/native'; @@ -1392,9 +1381,8 @@ describe('rehype-static-to-dynamic', () => { } `; - assert.strictEqual(output, expected); - } - ); + assert.strictEqual(output, expected); + }); test('drawer navigator', async () => { const input = dedent /* javascript */ ` diff --git a/src/plugins/rehype-static-to-dynamic.ts b/src/plugins/rehype-static-to-dynamic.ts index 324734fe932..7c08cea0556 100644 --- a/src/plugins/rehype-static-to-dynamic.ts +++ b/src/plugins/rehype-static-to-dynamic.ts @@ -432,8 +432,11 @@ export async function convertStaticToDynamic(code: string): Promise { } const navigatorVariable = declarator.id.name; // e.g., "MyStack" - const { type: navigatorType, config, withCallback } = - navigatorCallInfo; + const { + type: navigatorType, + config, + withCallback, + } = navigatorCallInfo; navigatorInfos.push({ originalName: navigatorVariable, @@ -1388,10 +1391,7 @@ function createJsxAttributeFromPropValue(key: string, value: t.Expression) { return t.jsxAttribute(t.jsxIdentifier(key), t.stringLiteral(value.value)); } - return t.jsxAttribute( - t.jsxIdentifier(key), - t.jsxExpressionContainer(value) - ); + return t.jsxAttribute(t.jsxIdentifier(key), t.jsxExpressionContainer(value)); } function getJsxAttributeName( @@ -1692,7 +1692,9 @@ function createFallbackMergedFunctionExpression( [argIdentifier], t.objectExpression([ t.spreadElement(createSpreadSourceExpression(staticValue, argIdentifier)), - t.spreadElement(createSpreadSourceExpression(dynamicValue, argIdentifier)), + t.spreadElement( + createSpreadSourceExpression(dynamicValue, argIdentifier) + ), ]) ); } @@ -1733,7 +1735,11 @@ function createMergedNavigatorPropExpression( const params = getMergedFunctionParams(staticValue, dynamicValue); if (staticObject && dynamicObject && params) { - return createMergedFunctionExpression(params, staticObject, dynamicObject); + return createMergedFunctionExpression( + params, + staticObject, + dynamicObject + ); } return createFallbackMergedFunctionExpression(staticValue, dynamicValue);