project_e_commerce
project_e_commerce copied to clipboard
Check the render method of `Form`
× 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?
Could you please share the code snippet here please
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> );