-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
🐛 TextInput:Function components cannot be given refs #44861
Comments
|
The error message is pretty self-explanatory. What is not clear about it? |
I don't believe this error should exist. The TextInput component itself provides the ref property. I've encountered this warning in many mature libraries, which makes me doubt its necessity. Do you have any suggestions for eliminating this warning in the example I provided? @cortinico |
It should be written like this
|
This comment was marked as resolved.
This comment was marked as resolved.
I believe I've figured out what caused the issue. It was related to NativeWind and the package https://www.npmjs.com/package/react-native-css-interop. After uninstalling it, the problem no longer occurs. |
Description
When I use
ref
onTextInput
, this problem always occurs stably:Steps to reproduce
React Native Version
0.74.1
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/@storyicon/honest-yellow-pretzel
Screenshots and Videos
The text was updated successfully, but these errors were encountered: