I want to add required attribute in MUI TextField based on a condition.
Var flag = false
If (investment>50000 && investment<5000){
flag = true
}
<TextField
required = {flag}
id="shop-name"
label="Shop Name"
variant="outlined" />
This doesn't seems to work