react-select in flex container

前端 未结 1 1090
面向向阳花
面向向阳花 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
      })
    };
    
    
                            
        
    提交评论

提交回复
热议问题