Board logo

標題: 請問es6 syntax [打印本頁]

作者: twaiho2003    時間: 2016-11-14 16:36     標題: 請問es6 syntax

const Todo = ({ onClick, completed, text }) => (
  <li
    onClick={onClick}
    style={{
      textDecoration: completed ? 'line-through' : 'none'
    }}
  >
    {text}
  </li>
)

以上果段係redux tutorial 抄出黎,  請問紅色果個syntax 叫咩名?
作者: Jackass_TMxCK    時間: 2016-11-14 16:50

Destructuring
作者: twaiho2003    時間: 2016-11-14 17:00

回覆 2# Jackass_TMxCK


  thx, 原來我google 緊果陣去過mdn Destructuring assignment呢頁,   但唔係夾埋arrow function, 我以為唔關事, 早知早d上黎問





歡迎光臨 電腦領域 HKEPC Hardware (https://h0.hkepc.com/forum/) Powered by Discuz! 7.2