Javascript flex容器中的react-select
如何使react select尊重flex布局?下面这些都不起作用Javascript flex容器中的react-select,javascript,reactjs,flexbox,react-select,Javascript,Reactjs,Flexbox,React Select,如何使react select尊重flex布局?下面这些都不起作用 const Container = styled('div')` width: 100%; height: 100%; display: flex; flex-flow: row wrap; justify-content: space-around; align-items: baseline; `; const selectStyles = { input: base =>
const Container = styled('div')`
width: 100%;
height: 100%;
display: flex;
flex-flow: row wrap;
justify-content: space-around;
align-items: baseline;
`;
const selectStyles = {
input: base => ({
minWidth: 200,
flex: 1,
<Container>
<Select
style={{ flex: 1 }}
styles={selectStyles}
const Container=styled('div'))`
宽度:100%;
身高:100%;
显示器:flex;
柔性流:行换行;
证明内容:周围的空间;
调整项目:基线;
`;
const selectStyles={
输入:base=>({
最小宽度:200,
弹性:1,
要使您的react选择component flex,您需要在容器上应用flex:1
道具,如下所示:
const styles = {
container: base => ({
...base,
flex: 1
})
};
<Select styles={styles} />
const styles={
容器:基=>({
基础
弹性:1
})
};
React select似乎不支持样式,也许您需要使用getStyles道具