'React Mui How to get the value from inside of another property?

I have the following code:

<TextField
    fullWidth
    InputLabelProps={{style:InputLabelStyle, shrink: this.props.value ===null? false:true}}//problem here
    label={<><IoIcons.IoMdBusiness/>&nbsp; Name</>}
    id="outlined-size-small"
    value={selectedValue?.first_name}
    color="primary"
    InputProps={{readOnly: true}}
/>

I'm trying to "fix" a bug that makes the label overlap the text if this is placed programmatically. So It seems I have to activate the label property "shrink". So I'm trying to make it just activate it when the textfield has something inside, otherwise, shrink should be false. However, I don't know how to reference value inside the inputLabelProps property. this.props.value is not working.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source