Replies: 2 comments 2 replies
-
| 
         Greetings @Bartyee , I haven't fully caught up on react hook form, but it seems like you could use the onChange prop of the field to update the form value per the Controller documentation here: Applying this to the code above, I would guess that the following should work for you. <Controller
          name="product"
          rules={{ required: true }}
          register={register}
          control={control}
          defaultValue={""}
          render={({ value, onChange, field }) => (
            <ReactSelect
              getOptionLabel={(option) => option.name}
              placeholder={""}
              id="form-input-product"
              isDisabled={editmode}
              required={true}
              getOptionValue={(option) => option.id}
              isClearable
              options={context.products}
              value={value}
              onChange={(selected: any) => {
                onChange(selected);
                field.onChange(selected.value);
              }}
            />
          )}
        /> | 
  
Beta Was this translation helpful? Give feedback.
                  
                    2 replies
                  
                
            -
| 
         I'm hitting the same problem :( I created issue for it #4973  | 
  
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everybody :)
First I would like to thank you for library, very useful and simple to use 👍
At the moment I have problem with react-select and my API. In our application we are using only ID for post and get values.
How I can get only id from select? At the moment on submit I have values like:
I want to have:
Here is my code:
At the moment Im using something like that:
Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions