dohomi / tamagui-kitchen-sink

Home of tamagui-extras, a component library which extends Tamagui with additional features..

Home Page:https://tamagui-extras.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I'm doing something wrong

tjapa opened this issue · comments

I'm using the LmInput component and I getting this error message in Expo:

 ERROR  Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `ForwardRef`.
    in _LmInput

My component is like this:

import { Input, YStack, Paragraph } from '@my/ui'
import { useController } from 'react-hook-form'

export default function FormInput({ name, control, error = '', label = '', ...otherProps }) {
  const { field } = useController({
    control,
    defaultValue: '',
    name,
  })

  return (
    <YStack gap="$1">
      {!!label && <Paragraph>{label}</Paragraph>}
      <Input
        value={field.value}
        onChangeText={field.onChange}
        error={Boolean(error)}
        {...otherProps}
      ></Input>
      {!!error && <Paragraph error={Boolean(error)}>{error}</Paragraph>}
    </YStack>
  )
}

The Input component is a LmInput.

Can someone help me?

I don't how but the problem was solved.