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

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

Open
muhammaddiyor0104 opened this issue Nov 16, 2023 · 2 comments

Comments

@muhammaddiyor0104
Copy link

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?

@rapitkan
Copy link

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

@erashu212
Copy link

@muhammaddiyor0104 @rapitkan Please share codesandbox link with the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants