2016-05-18 7 views

答えて

2

See this post from the React blogです。

コンストラクタで設定します。

import {Component} from 'react'; 

class App extends Component { 
    constructor(props) { 
    super(props); 
    this.state = {data: 'test'}; 
    } 
    render() { ... } 
} 

はまた、私はあなたがもはやものですReact.renderを使用している気づきます。

import {render} from 'react-dom' 

// ... 
render(<App/>, document.getElementyById('app')); 
+0

@namikリアクションのための良いチュートリアル> – user944513

+0

@ user944513オンラインでは無数のリソースがあります。 Reactがやや頻繁に変更されているので、何か最新のものを勉強していることを確認してください。私はまた、Reactのブログを読んで、それらの変更を詳述する素晴らしい仕事をしています。 – naomik

関連する問題