Skip to content

Commit 70e4c92

Browse files
authored
KeyboardAccessoryView - fix "Argument appears to not be a ReactComponent" (#3710)
1 parent 30c77d5 commit 70e4c92

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/components/Keyboard/KeyboardInput/TextInputKeyboardManager/TextInputKeyboardManager.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class TextInputKeyboardManager {
4444
}
4545

4646
function findNodeHandle(ref: any) {
47-
return ReactNative.findNodeHandle(ref.current || ref);
47+
return ref.current?.getNodeHandle?.() || ref?.getNodeHandle?.() || ReactNative.findNodeHandle(ref.current || ref);
4848
}
4949

5050
const springAnimation = {

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uilib-native",
3-
"version": "4.5.1",
3+
"version": "4.5.2",
44
"homepage": "https://github.com/wix/react-native-ui-lib",
55
"description": "uilib native components (separated from js components)",
66
"main": "components/index",

src/components/textField/useImperativeInputHandle.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React, {useContext, useImperativeHandle, useRef} from 'react';
2-
import {TextInput, TextInputProps} from 'react-native';
2+
import {findNodeHandle, TextInput, TextInputProps} from 'react-native';
33
import FieldContext from './FieldContext';
44

55
const useImperativeInputHandle = (ref: React.Ref<any>, props: Pick<TextInputProps, 'onChangeText'>) => {
66
const inputRef = useRef<TextInput>();
77
const context = useContext(FieldContext);
88
useImperativeHandle(ref, () => {
99
return {
10+
getNodeHandle: () => inputRef.current ? findNodeHandle(inputRef.current) : null,
1011
isFocused: () => inputRef.current?.isFocused(),
1112
focus: () => inputRef.current?.focus(),
1213
blur: () => inputRef.current?.blur(),

0 commit comments

Comments
 (0)