alsoscotland / react-super-select

MIT License
95 stars 33 forks source link

Passing an array/object in initialValue #106

Closed oyeanuj closed 7 years ago

oyeanuj commented 7 years ago

Hi @alsoscotland, this isn't as much of an issue as a question, so feel free to close. I was wondering if I could understand better the choice of initialValue to be an object or array of object, rather than the index in the dataSource or the id of the object in the dataSource?

I either end up doing dataList[initialIndex] as the initialValue prop or construct an object. Constructing an object as initialValue makes me a little nervous as it increases the scope for making a subtle mistake.

I am probably missing some context or trick, hance the question.

Thank you!

alsoscotland commented 7 years ago

@oyeanuj I made a choice in the control that the selected value would always be an array of option objects rather than just the array of values for a particular key. This keeps that behavior consistent