Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyboardAccessoryView no longer working as of React 18 #2829

Open
3 of 7 tasks
gurs1kh opened this issue Nov 29, 2023 · 2 comments
Open
3 of 7 tasks

KeyboardAccessoryView no longer working as of React 18 #2829

gurs1kh opened this issue Nov 29, 2023 · 2 comments
Labels
bug a bug in one of the components

Comments

@gurs1kh
Copy link

gurs1kh commented Nov 29, 2023

Description

It appears that the KeyboardAccessoryView component no longer works as expected. When toggle to a custom keyboard, I was getting this following error. After seeing this, I decided to clone this repo to run the demo and I saw the same exact issue.

ERROR  Error: Argument appears to not be a ReactComponent. Keys: isFocused,focus,blur,clear,validate,isValid

I looked a bit more into it and tracked the issue down to this line:
https://github.com/wix/react-native-ui-lib/blob/master/lib/components/Keyboard/KeyboardInput/TextInputKeyboardManager/TextInputKeyboardManager.ios.ts#L47

I think it's most likely related to the recent changes regarding findNodeHandle, which is mentioned to be incompatible with React 18:
https://reactnative.dev/docs/0.70/new-architecture-library-intro#preparing-your-javascript-codebase-for-the-new-react-native-renderer-fabric

I have not tested on Android, but I'd assume it wouldn't work there either if what's mentioned above is the cause of this issue.

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

  1. clone and install dependencies for react-native-ui-lib
  2. run yarn run ios
  3. go to KeyboardAccessoryView screen in app
  4. tap either of the keyboard accessory buttons to toggle the keyboard
  5. see error

Expected behavior

When the keyboard toggle button is tapped, the custom keyboard should be shown

Actual behavior

When the keyboard is toggled, you get this error:

ERROR  Error: Argument appears to not be a ReactComponent. Keys: isFocused,focus,blur,clear,validate,isValid

This error is located at:
    in IGNORE (created by CustomKeyboardView)
    in CustomKeyboardView (created by KeyboardAccessoryView)
    in KeyboardTrackingViewTemp (created by KeyboardTrackingView)
    in KeyboardTrackingView
    in _c (created by KeyboardAccessoryView)
    in KeyboardAccessoryView (created by KeyboardAccessoryViewScreen)
    in RCTView (created by View)
    in View
    in View (created by KeyboardAccessoryViewScreen)
    in KeyboardAccessoryViewScreen (created by WrappedComponent)
    in WrappedComponent
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in unicorn.nativeComponents.KeyboardAccessoryViewScreen(RootComponent), js engine: hermes

More Info

Code snippet

No changes from master branch

Screenshots/Video

Simulator.Screen.Recording.-.iPhone.14.-.2023-11-28.at.18.38.14.mp4

Environment

  • React Native version: 0.71.2
  • React Native UI Lib version: 7.0.0

Affected platforms

  • Android
  • iOS
  • Web
@gurs1kh gurs1kh added the bug a bug in one of the components label Nov 29, 2023
@GregNing
Copy link

trying pass ref to renderContent for textInput, if you have use kbInputRef

@dungdt9x
Copy link

It already have textInputRef but still get errors. Please check it again @GregNing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in one of the components
Projects
None yet
Development

No branches or pull requests

3 participants