Hi,
I have a problem to implement react-select component to Stepper.
I always get initials values, not these selected from Select
my code:
interface:
export interface ICreateBot {
...
selectPairs: { value: string, label: string }
...
}
inits:
const inits: ICreateBot = {
...
selectPairs: { value: '', label: '' },
...
}
YUP:
const createSchemas = [
...
Yup.object({
selectPairs: Yup.object().shape({
value: Yup.string().required("Required"),
label: Yup.string().required("Required"),
}),
})
]
Select:
const pairsData = [
{ value: 'BTCU/USDT', label: 'BTCU/USDT' },
{ value: 'ETH/USDT', label: 'ETH/USDT' },
{ value: 'LTC/USDT', label: 'LTC/USDT' }
]
<Select
options={pairsData}
defaultValue={pairsData[0]}
name='selectPairs'
/>
<div className='text-danger mt-2'>
<ErrorMessage name='selectPairs' />
</div>