Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.4 kB
2
Indexable
Never
<Controller
                name='selectemail'
                rules={{ required: true }}
                control={control}
                render={({ field: { value, onChange } }) => (
                  <CustomTextField1
                    select
                    fullWidth
                    style={{ width: '550px', marginTop: '20px' }}
                    defaultValue=''
                    label='Choose an Email Account'
                    SelectProps={{
                      value: value,
                      onChange: e => {
                        onChange(e)
                        localStorage.setItem('emailemail', e.target.value)
                      }
                    }}
                    id='validation-basic-select'
                    error={Boolean(errors.select)}
                    aria-describedby='validation-basic-select'
                    {...(errors.select && {
                      helperText: 'This field is required'
                    })}
                  >
                    {emailList.map((location, index) => (
                      <MenuItem key={index} value={emailList[index].username}>
                       
                        {emailList[index].username}
                      </MenuItem>
                    ))}
                  </CustomTextField1>
                )}
              />
Leave a Comment