ES6 - Arrow function

0 votes
107 views
added May 10, 2019 in ES6 by LC Marshal Captain (25,770 points)
const onClickPropertyType = () => {
    let targetPath;
    if (listingType === 'Sale') {
      targetPath = '/buy';
    } else if (listingType === 'Rent') {
      targetPath = '/rent';
    }
    const parseQbject = JSON.parse(JSON.stringify({
      state,
      page: 1,
      propertyType: PropertyTypeQuery,
    }));
    Router.push({
      pathname: targetPath,
      query: { ...parseQbject },
    });
};

return (
  <div>
      <li className="breadcrumb-item"><a onClick={onClickPropertyType}>{PropertyType}</a></li>
  </div>
);

 

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