React-Select - Replacing Components for custom option content

前端 未结 3 1234
渐次进展
渐次进展 2021-02-02 12:51

Using React-Select (version 2) I would like to have custom designed (select) options.

The documentation suggests that Replacing Components would be a method that I could

3条回答
  •  天涯浪人
    2021-02-02 13:39

    You can replace any component by including your override in the components property.

    
    

    The innerRef and innerProps properties are very important, as they carry forward things like the hover and onClick needed by the Option. The data in props is where your option data is.

提交回复
热议问题