fix: use Select value instead of defaultValue
when defaultValue is used to pass the current value of Select, a warning is produced in the console: "cannot update a component while rendering a different component `Controller`". an unrelated issue (https://github.com/shadcn-ui/ui/issues/1253) that suggested using the value prop instead of defaultValue somehow fixed this problem
This commit is contained in:
@@ -192,7 +192,7 @@ function NewWorkspaceForm({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Image for this workspace</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<Select onValueChange={field.onChange} value={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select an image" />
|
||||
@@ -217,7 +217,7 @@ function NewWorkspaceForm({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Docker runtime</FormLabel>
|
||||
<Select onValueChange={field.onChange} defaultValue={field.value}>
|
||||
<Select onValueChange={field.onChange} value={field.value}>
|
||||
<FormControl>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select a Docker runtime" />
|
||||
|
Reference in New Issue
Block a user