**Uncaught Error: Objects are not valid as a React child (found: object with keys {label, value, __isNew__}). If you meant to render a collection of children, use an array instead.**
getting this error when giving value prop to the component
this is the tags array i am getting from api ["apple","orange","banana"]
this is my code
<CreatableSelect
isMulti
name="tags"
value={values?.tags?.map((tag, index) => ({
value: tag,
label: tag,
}))}
defaultValue={values?.tags?.map((tag, index) => ({
value: tag,
label: tag,
}))}
getOptionValue={(option) => option.value}
getOptionLabel={(option) => option.label}
onChange={(option) => {
setFieldValue("tags", option);
}}
/>