From 56a8eea965ad9bc4d48476586a0c0fff2f9af630 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:51:45 -0800 Subject: [PATCH 1/4] win32 has implemented the focus method on UIManager for quite a while at this point --- .../src/useViewCommandFocus.win32.ts | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 packages/utils/interactive-hooks/src/useViewCommandFocus.win32.ts diff --git a/packages/utils/interactive-hooks/src/useViewCommandFocus.win32.ts b/packages/utils/interactive-hooks/src/useViewCommandFocus.win32.ts deleted file mode 100644 index 211738b16b..0000000000 --- a/packages/utils/interactive-hooks/src/useViewCommandFocus.win32.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as React from 'react'; -import { findNodeHandle, UIManager } from 'react-native'; - -import type { ViewWin32 } from '@office-iss/react-native-win32'; - -import { setAndForwardRef } from './setAndForwardRef'; - -export type IFocusable = ViewWin32; -/** - * A hook to add an imperative focus method to functional components which simply dispatch a focus command to - * something View-derived on the native side. In practice, this effectively applies to all components in our Win32 - * react native implementation. - * @param forwardRef - The componentRef from your component's props where you're exposing a imperative focus method. - * @returns The inner View-type you're rendering that you want to dispatch to & focus on. - */ -export function useViewCommandFocus( - forwardedRef: React.Ref | undefined, - // initialValue?: React.Component -): (ref: React.ElementRef) => void { - /** - * Set up the forwarding ref to enable adding the focus method. - */ - const focusRef = React.useRef(); - - const _setNativeRef = setAndForwardRef({ - getForwardedRef: () => forwardedRef, - setLocalRef: (localRef: any) => { - focusRef.current = localRef; - - /** - * Add focus() as a callable function to the forwarded reference. - */ - if (localRef) { - localRef.focus = () => { - UIManager.dispatchViewManagerCommand(findNodeHandle(localRef), UIManager.getViewManagerConfig('RCTView').Commands.focus, null); - }; - } - }, - }); - return _setNativeRef; -} From b5f2c7919282e337dbab12b23b0c1b31464d4bc9 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:51:56 -0800 Subject: [PATCH 2/4] Change files --- ...ractive-hooks-d8845be0-8252-468e-9f16-8e4e13ce4a8f.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-native-interactive-hooks-d8845be0-8252-468e-9f16-8e4e13ce4a8f.json diff --git a/change/@fluentui-react-native-interactive-hooks-d8845be0-8252-468e-9f16-8e4e13ce4a8f.json b/change/@fluentui-react-native-interactive-hooks-d8845be0-8252-468e-9f16-8e4e13ce4a8f.json new file mode 100644 index 0000000000..5bdd17e950 --- /dev/null +++ b/change/@fluentui-react-native-interactive-hooks-d8845be0-8252-468e-9f16-8e4e13ce4a8f.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "win32 has implemented the focus method on UIManager for quite a while at this point", + "packageName": "@fluentui-react-native/interactive-hooks", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} From d43c9d18bd81cc3366fedded34fb1a975006e8da Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:26:02 -0800 Subject: [PATCH 3/4] update rex-win32 --- apps/win32/package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/win32/package.json b/apps/win32/package.json index 8e8bad19bb..f7f9b5cc33 100644 --- a/apps/win32/package.json +++ b/apps/win32/package.json @@ -40,7 +40,7 @@ "@fluentui-react-native/eslint-config-rules": "^0.1.1", "@fluentui-react-native/scripts": "^0.1.1", "@office-iss/react-native-win32": "^0.72.0", - "@office-iss/rex-win32": "0.71.41-devmain.17024.10000", + "@office-iss/rex-win32": "0.72.25-devmain.16.0.17327.15000", "@react-native/metro-config": "^0.72.0", "@rnx-kit/cli": "^0.16.2", "@rnx-kit/metro-config": "^1.3.1", diff --git a/yarn.lock b/yarn.lock index 8db4ca2916..7d86d600be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3743,7 +3743,7 @@ __metadata: "@fluentui-react-native/scripts": ^0.1.1 "@fluentui-react-native/tester": ^0.167.3 "@office-iss/react-native-win32": ^0.72.0 - "@office-iss/rex-win32": 0.71.41-devmain.17024.10000 + "@office-iss/rex-win32": 0.72.25-devmain.16.0.17327.15000 "@react-native/metro-config": ^0.72.0 "@rnx-kit/cli": ^0.16.2 "@rnx-kit/metro-config": ^1.3.1 @@ -4994,15 +4994,15 @@ __metadata: languageName: node linkType: hard -"@office-iss/rex-win32@npm:0.71.41-devmain.17024.10000": - version: 0.71.41-devmain.17024.10000 - resolution: "@office-iss/rex-win32@npm:0.71.41-devmain.17024.10000" +"@office-iss/rex-win32@npm:0.72.25-devmain.16.0.17327.15000": + version: 0.72.25-devmain.16.0.17327.15000 + resolution: "@office-iss/rex-win32@npm:0.72.25-devmain.16.0.17327.15000" dependencies: command-line-args: ^5.0.2 command-line-usage: ^5.0.5 bin: rex-win32: rex-win32.js - checksum: 2ffa6dc0ee7ce024bc17866e861bc9ad5b8680bbcf1e08bb48d7befba7b5afb9dcca7072a0c6c8498116c5d38b15184089655ae3159338c8bbc5f585c7a9865c + checksum: e433b9e27a7dc18141161c752d0521c909faea698d555afddd11f32f46ae4eee49ee429ce1c3bb365bcf83d1b7e1ae8e765d1f7e0007e8f47f319865833d76fa languageName: node linkType: hard From a25a074e1c866858d561bbe24f99f7c29cce4893 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 29 Jan 2024 17:30:49 -0800 Subject: [PATCH 4/4] Change files --- ...-tester-win32-62e3926a-2f76-424b-9fdc-b59946a29dbc.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@fluentui-react-native-tester-win32-62e3926a-2f76-424b-9fdc-b59946a29dbc.json diff --git a/change/@fluentui-react-native-tester-win32-62e3926a-2f76-424b-9fdc-b59946a29dbc.json b/change/@fluentui-react-native-tester-win32-62e3926a-2f76-424b-9fdc-b59946a29dbc.json new file mode 100644 index 0000000000..2f109043c9 --- /dev/null +++ b/change/@fluentui-react-native-tester-win32-62e3926a-2f76-424b-9fdc-b59946a29dbc.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "update rex-win32", + "packageName": "@fluentui-react-native/tester-win32", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +}