v2 paste interception silently bails on RN 0.76+ Fabric (uses `__nativeTag` which is undefined)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- ios, react-native, typescript
- Domain
- mobile
Research direction
Start in src/PasteInput.tsx around line 83 and trace the useEffect path that obtains the native tag and calls NativePasteInputModule.registerTextInput. Reproduce on RN 0.76+ with Fabric enabled and image-only clipboard content; done when paste interception registers and onPaste fires without the development warning.
Written by the indexing model from the issue text.
Description
Summary
On v2.0.0 / v2.0.1, the iOS paste interception silently fails to register on RN 0.76+ with the New Architecture (Fabric) enabled. The Edit Menu / QuickType "Paste" / long-press → Paste actions fall through to the default UITextView paste handler, which does nothing for image-only clipboard contents — making it look like nothing happens on paste.
Root cause
PasteInputIOSComponent reads the React Native tag via the __nativeTag property (double underscore):
// src/PasteInput.tsx
const nativeTag = textInputRef.current?.__nativeTag;
if (!nativeTag) {
if (__DEV__) {
console.warn('[PasteInput] Could not get native tag from ref');
}
return;
}
That property name is from the legacy renderer. Under Fabric (RN ≥ 0.76 with RCT_NEW_ARCH_ENABLED=1), the renderer exposes the tag as _nativeTag (single underscore) on the component instance — see e.g. react-native@0.83.6 Libraries/Renderer/implementations/ReactNativeRenderer-prod.js line ~1372:
var tag = inst._nativeTag;
So on Fabric textInputRef.current?.__nativeTag is undefined, the useEffect bails before calling NativePasteInputModule.registerTextInput, and the native module never attaches its paste: swizzle to the underlying UITextView. In __DEV__ this surfaces as the [PasteInput] Could not get native tag from ref console warning; in release builds it's a silent no-op.
Repro
- RN ≥ 0.76 with new arch on (
RCT_NEW_ARCH_ENABLED=1) - v2.0.0 or v2.0.1 installed
- Mount a
<PasteInput onPaste={...} />and focus it - Copy an image to the clipboard (host macOS → iOS Simulator works;
public.pngon the pasteboard) - Tap the system Paste affordance — no
onPasteevent fires; no JS callback; in DEV the warning prints once at mount
Confirmed on RN 0.83.6 + Expo 55.0.16 + new arch enabled.
Suggested fix
Use findNodeHandle from react-native, which is the public API and works across both legacy and Fabric (returns the underlying _nativeTag on Fabric):
import { findNodeHandle } from 'react-native';
const nativeTag = textInputRef.current
? findNodeHandle(textInputRef.current)
: null;
findNodeHandle is a thin wrapper around the same renderer-internal tag lookup, just with the correct property name per renderer.
Happy to send a PR.
Workaround
For anyone hitting this before a fix lands, a patch-package / pnpm patch diff against lib/commonjs/PasteInput.js and lib/module/PasteInput.js swapping textInputRef.current?.__nativeTag for findNodeHandle(textInputRef.current) (with the import added in lib/module/PasteInput.js) restores paste interception.
- Dominant language
- Objective-C
- Stars
- 213
- Forks
- 38
- Avg merge
- 12h 25m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mattermost/react-native-paste-input
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
mattermost/react-native-paste-input#47 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
All issues in mattermost/react-native-paste-input
Similar issues
-
clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/openclaw-facetime#40 · 2 comments · 1 reaction ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
noah-nuebling/mac-mouse-fix#2054 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
obsproject/obs-studio#13918 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SwiftOldDriver/iOS-Weekly#5439 · 1 comment ·