react-select in flex container

前端 未结 1 1069
面向向阳花
面向向阳花 2021-01-22 06:43

How can I make react-select to respect flex layout? Nothing of the below worked.

 const Container = styled(\'div\')`
   width: 100%;
   height: 100%;
   display:         


        
相关标签:
1条回答
  • 2021-01-22 07:07

    To make your react-select component flex you need to apply flex:1 props on the container like this:

    const styles = {
      container: base => ({
        ...base,
        flex: 1
      })
    };
    
    <Select styles={styles} />
    
    0 讨论(0)
提交回复
热议问题