タグ付けされた質問 「react-select」

13
react-selectでデフォルト値を設定する方法
react-selectの使用に問題があります。私はreduxフォームを使用しており、react-selectコンポーネントをreduxフォームと互換性のあるものにしました。コードは次のとおりです。 const MySelect = props => ( <Select {...props} value={props.input.value} onChange={value => props.input.onChange(value)} onBlur={() => props.input.onBlur(props.input.value)} options={props.options} placeholder={props.placeholder} selectedValue={props.selectedValue} /> ); そしてここで私はそれをどのようにレンダリングするか: <div className="select-box__container"> <Field id="side" name="side" component={SelectInput} options={sideOptions} clearable={false} placeholder="Select Side" selectedValue={label: 'Any', value: 'Any'} /> </div> しかし、問題は、ドロップダウンに希望どおりのデフォルト値がないことです。私が間違っているのは何ですか?何か案は?
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.