Is there any way so that I can minimize the following code-
<div className="App">
<Checkbox parameter={parameter1} setParameter={setParameter1}></Checkbox>
{ parameter1.country && parameter1.category ?
<ShowData parameter1={parameter1}></ShowData>
: ""
}
{ parameter1.country && parameter1.category ?
<Chart1></Chart1>
: ""
}
{ parameter1.country && parameter1.category ?
<Chart2></Chart2>
: ""
}
</div>
Here I have mentioned parameter1.country && parameter1.category
three times. I want to write just single time.