動くコード図鑑技術記事現場の渡り方キャリア論すべての記事About
SQL

Component

出典: Typescript×Reduxでカウンタアプリ作ってみる!各ソースコード / Component

Component (sql)#038f1a12561a
import React from "react";

import {IState} from "../Reducers/CounterReducer";

import {ActionDispather} from "./Container";



interface Props {

   value : IState;

   actions : ActionDispather

}





class Counter extends React.Component<Props, {}>{



   render() {

      return (

         <div>

            <p>{this.props.value.num}</p>

            <button type={"button"} onClick={() => this.props.actions.Increment()}>Increment</button>

            <button type={"button"} onClick={() => this.props.actions.Decrement()}>Increment</button>

         </div>

      )

   }

}



export default Counter
▸ この snippet は実行結果未収録
▸ 実行結果は未収録です
  • id: #038f1a12561a
  • lines: 24
  • extracted: 2026-06-10

Source収録記事

この snippet は記事の「各ソースコード / Component」セクションに登場する。コードの前後の文脈・ハマりどころの解説は記事本文で。

同じ記事から

5
図鑑トップ