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

Check the render method of Form #49

Open
mohammadalizafar opened this issue Jan 18, 2022 · 2 comments
Open

Check the render method of Form #49

mohammadalizafar opened this issue Jan 18, 2022 · 2 comments

Comments

@mohammadalizafar
Copy link

×
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

I Have got same issue any solution plz?

@shvkumar7777
Copy link

Could you please share the code snippet here please

@rjmead23
Copy link

rjmead23 commented Mar 23, 2022

Without the code throwing the error this is going to be hard for people to help you out. Are you able to paste the code here?

If you are talking about an issue in the CustomTextField.jsx file then I had to change from this:

return ( <Grid item xs={12} sm={6}> <Controller as={TextField} control={control} fullwidth name={name} label={label} required={required} /> </Grid> );

to add render like this:

return ( <Grid item xs={12} sm={6}> <Controller control={control} name={name} render={({ field }) => ( <TextField fullwidth='true' label={label} required /> )} /> </Grid> );

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