Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TypeScript+React入門

rchaser53
December 19, 2016

 TypeScript+React入門

rchaser53

December 19, 2016
Tweet

More Decks by rchaser53

Other Decks in Programming

Transcript

  1. 例1. props のinterface だけでも効果あり export interface Props { name: string

    label: string index: number } export class Row extends React.Component< Props, {} > { // 略 }
  2. 例2. 導入が楽なところから攻める( 型編) readonly property を読取り専用にする export interface Circle {

    readonly radius: number x: number y: number } let circleA: CirCle = { radius: 10, x: 5, y: 5 } circleA.radiux = 20 // Error! circleA.x = 10 // ok