react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

TextField error on web: "Function components cannot be given refs. [...]"

Open MichaelHerrmann1 opened this issue 9 months ago • 0 comments

Description

Using a TextField produces error on web: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Related to

  • [x] Components
  • [ ] Demo
  • [ ] Docs
  • [ ] Typings

Steps to reproduce

Steps to reproduce the behavior:

  1. Use an expo project with current RNUILib v7.22.0
  2. Add <TextField ... />
  3. Start expo dev server and open web
  4. See error

More Info

I guess this error was introduced in v7.14.0 with #2874 .
src/components/textField/textInput/index.web.tsx probably just needs a forwardRef(...)

Environment

  • React Native version: 0.74.1
  • React Native UI Lib version: 7.22.0

Affected platforms

  • [ ] Android
  • [ ] iOS
  • [x] Web

MichaelHerrmann1 avatar May 23 '24 08:05 MichaelHerrmann1