How do I remove the height of the following div when I want to hide the component?

how do I remove the height of the following style= {{height:"49px"}} when I want to hide the {productfobpricedom} component?

let msgdom ="";

    if (productsubjectdom || minorderunitdom || productfobpricedom || modifiershowdom || maskmoduledom) {
        msgdom = <div className={"msgbox"} style={{ backgroundColor: itemstyle.msgbgcolor, }}>
                {productfobpricedom}
                <div style={{ height:"49px"}}>
                    {minorderunitdom}
                    {modifiershowdom}
                    {productsubjectdom}
                </div>
            </div>
    }
Apr.27,2022

you can bind style according to the value that controls whether the component is hidden or not.

Menu