project_e_commerce icon indicating copy to clipboard operation
project_e_commerce copied to clipboard

Check the render method of `Form`

Open mohammadalizafar opened this issue 3 years ago • 2 comments

× 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?

mohammadalizafar avatar Jan 18 '22 15:01 mohammadalizafar

Could you please share the code snippet here please

shvkumar7777 avatar Jan 27 '22 16:01 shvkumar7777

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> );

rjmead23 avatar Mar 23 '22 17:03 rjmead23