2017-03-06 4 views
0

私はreact-reduxaxiosを使用してjsonデータを取得し、コンポーネントを更新したいのですが、何度も試してみました。 :?ここreact-reduxは私のコンテナを表示できません

<div id="root"> 
    <simple_result_container data-reactroot=""></simple_result_container> 
</div> 

が私のコードで、私は何かが欠けています私にできるだけ多くを教えてください、これは私にとって非常に混乱して、あなたは私がreact-redux .ANYを使用して取得し、JSONデータを表示することができますどのように説明することができます助けに感謝します。

index.js

render(
    <Provider store={store}> 
     <simple_result_container ddd="da" /> 
    </Provider>, 
    document.getElementById('root') 
); 

simple_result_container.js

@connect(state => state, dispatch => bindActionCreators({get_simple_result}, dispatch)) 
export class simple_result_container extends Component { 
    constructor(props) { 
     super(props); 
    } 

    componentWillMount() { 
     const {simple_result_value} = this.props.simple_result_tmp; 
     if (simple_result_value === "") { 
      this.props.get_simple_result(); 
     } 
    } 
    render() { 
     const {simple_result_value} = this.props.simple_result_tmp; 
     return (
      <div className={bb}> 
       <div className="aa"> 
        <simple_result_component 
         code={simple_result_value.code} 
         msg={simple_result_value.msg} 
        /> 
       </div> 
      </div> 
     ); 
    } 
} 

答えて

2

コンポーネント名を書き込み、大文字でなければなりません。

HTML tags vs React Components

+0

私の間違い!あなたの思い出してくれてありがとう。 – McGrady

関連する問題