Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

ES6 - Destructuring

0 votes
16 views
added Feb 27 in ES6 by LC Marshal Captain (20,510 points)
// instead of 
var Router = require('react-router').Router
var Route = require('react-router').Route
var Link = require('react-router').Link

// to
import {Router, Route, Link} from 'react-router';

 

1 Response

0 votes
responded Mar 6 by LC Marshal Captain (20,510 points)
//API
// "result": {
//         "_id": {
//             "$oid": "5c7cd95997468a7fc56eef3e"
//         },
//         "nid": 1486969,
//         "mid": 1068533,
//         "uid": "75517",
//         "title": "FULLY RENOVATED Semi D Tiara Heights Sepang",
//         "changed": 1551685977,
//         "state": "Selangor",
//         "district": "Sepang",
//         "asset": {
//             "project_name": "Tiara Heights",
//             "state": "Selangor",
//             "district": "Sepang",
//             "street_name": "JALAN TIARA HEIGHTS",
//             "tenure": "Freehold,Leasehold",
//             "property_type_group": "l"
//         },

const { result: { title, state, district, changed, asset: { project_name } } } = ColumnMainData; 

<div className="detail-info-pre-1">{project_name}, {district}, {state} </div>

 

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