microsoft / microsoft/react-native-windows

Remove all uses of findNodeHandle

Open
#4,183 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Fabric Code Cleanup enhancement New Architecture Workstream: Component Parity
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

tags aren't supported by Fabric. The main function that deals with tags is findNodeHandle(). Facebook is replacing all tags with instances. We need to do the same in our overrides.

There are multiple places we're doing this:
Libraries\Components\Flyout\Flyout.windows.tsx:42: const newtarget: number | null = findNodeHandle(nextProps.target as
Libraries\Components\Popup\Popup.windows.tsx:42: const newTarget: number | null = findNodeHandle(nextProps.target as
Libraries\Components\ScrollView\ScrollView.windows.js:752: return ReactNative.findNodeHandle(this._scrollViewRef);
Libraries\Components\ScrollView\ScrollView.windows.js:756: return ReactNative.findNodeHandle(this._innerViewRef);
Libraries\Components\TextInput\TextInput.windows.js:825: ReactNative.findNodeHandle(this._inputRef)
Libraries\Components\TextInput\TextInput.windows.js:837: const tag = ReactNative.findNodeHandle(this._inputRef);
Libraries\Components\TextInput\TextInput.windows.js:853: const tag = ReactNative.findNodeHandle(this._inputRef);
Libraries\Lists\VirtualizedList.windows.js:444: return ReactNative.findNodeHandle(this._scrollRef);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the listed call sites in Libraries/Components/Flyout/Flyout.windows.tsx, Popup/Popup.windows.tsx, ScrollView/ScrollView.windows.js, TextInput/TextInput.windows.js, and Lists/VirtualizedList.windows.js, then search the repository for other uses. Determine how the overrides should use instances instead of tags, and verify that no override still calls findNodeHandle while preserving the affected component behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native, typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.