formik icon indicating copy to clipboard operation
formik copied to clipboard

i am getting error even while using useField inside of Formik - Cannot read properties of undefined (reading 'getFieldProps')

Open muhammaddiyor0104 opened this issue 2 years ago • 4 comments

i have my own ui library and my form elements uses useField

import React from 'react';
import { TextField } from '../input/Input';

interface Props {
  readonly name: string
}

export function FormInput({name, ...props}:Props) {
  // const [field] = useField(name)
  console.log("field:", props);
  return (
    <TextField {...props} />
  );
}

but when i install my lib and use my fileds inside of formik i am getting this error Cannot read properties of undefined (reading 'getFieldProps')

what i am doing wrong?

muhammaddiyor0104 avatar Nov 16 '23 13:11 muhammaddiyor0104

Same error here with Formik 2.4.5 and Storybook 8.0.8. Did you got the problem solved, @muhammaddiyor0104 ?

rapitkan avatar Apr 18 '24 14:04 rapitkan

@muhammaddiyor0104 @rapitkan Please share codesandbox link with the issue

erashu212 avatar May 14 '24 13:05 erashu212

Same issue for me

stardustdev avatar Jul 16 '24 13:07 stardustdev