検索
  • サインイン
  • サインアップ
パスワードのリセットが成功しました

興味のあるプロジェクトをフォローし、それらに関する最新ニュースをチェックしてください

プログラミング辞典

サービスプログラマー向けのオンライン技術マニュアル
人気の検索:
React Props 使用方法の詳細

React Props

中国語翻訳 最近の更新: 2018-06-21 11:24:17

state と props の主な違いは、props は不変であるのに対し、state はユーザーの操作に基づいて変更できることです。

React Props 構文

state と props の主な違いは、props は不変であるのに対し、state はユーザーの操作に基づいて変更できることです。

React Props 例

var HelloMessage = React.createClass({
  render: function() {
    return <h1>Hello {this.props.name}</h1>;  }}); 
ReactDOM.render(
  <HelloMessage name="php.cn" />,  document.getElementById('example')


React Props