score:2

Accepted answer
const ParentComponent = (data) => {
    const name = data.name;
    const type = data.type;
    const label = <span style={{marginLeft: '4px'}}>${name} ${type}</span>;
    
    return (
        <Checkbox
            label = {label}
        />
        //some other logic
    );
}

Related Query

More Query from same tag