Javascript 如何更改react select Automatic react js的宽度和高度

Javascript 如何更改react select Automatic react js的宽度和高度,javascript,html,css,reactjs,Javascript,Html,Css,Reactjs,我已经选择了元素,我想使用值更改元素的宽度和高度。长度我的代码如下所示: width: `${(8*newValue.length) + 100}px`, height: , 当宽度大于300px时,那么高度+50px我想你可以这样做 style={(8*newValue.length) + 100>300?{width: `${(8*newValue.length) + 100}px`,height:`${height + 50}px`}:{width: `${(8*newValue.

我已经选择了元素,我想使用
值更改元素的宽度和高度。长度
我的代码如下所示:

width: `${(8*newValue.length) + 100}px`,
height: ,

宽度
大于
300px
时,那么
高度+50px

我想你可以这样做

style={(8*newValue.length) + 100>300?{width: `${(8*newValue.length) + 100}px`,height:`${height + 50}px`}:{width: `${(8*newValue.length) + 100}px`,height:`${height}px`}}

这取决于用例。您可以使用引导网格系统控制它,如