React - assign value based on condition

0 votes
231 views
added Mar 6, 2019 in React by LC Marshal Captain (25,790 points)
retagged Mar 6, 2019 by LC Marshal
const PropertyTypeTarget = ColumnMainData.result.field_property_type.und['0'].target_id;
  let PropertyType;
  if(PropertyTypeTarget == 35) {
    PropertyType = 'Condominium';
  } else if (PropertyTypeTarget == 36) {
    PropertyType = 'Bungalow';
  }
  else if (PropertyTypeTarget == 36 && 38) {
  }
  else {
  }
  
  <div>{PropertyType}</div>

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...