2017-06-04 18 views
0

react-nativeとreduxでカウンタを作成しようとしていますが、エラーExpected a component class, got [object Object]が表示されています。react-nativeとreduxとの接続に問題があります

これは私のコードはhereを見つけることができる私のindex.android.js

import React, { Component } from 'react'; 
import { AppRegistry } from 'react-native'; 

import Root from './src/containers/Root'; 
import configureStore from './configureStore'; 

export default class CounterReactNativeRedux extends Component { 
    render() { 
    return (<Root store={configureStore()} />) 
    } 
} 

AppRegistry.registerComponent('CounterReactNativeRedux',() => CounterReactNativeRedux); 

です。

これは、クラス名が大文字に変換されていない可能性がありますが、これは該当しないとの回答が見つかりました。

誰でも構いません。

答えて

1

Counter.jsをご覧ください。 React Nativeに存在しないタグdivを使用しています。

したがって、React NativeのViewタグをインポートして使用してください。

import {View} from 'react-native' 

const Counter = ({ value }) => (
    <View>{value}</View> 
); 
+0

これはまさに私の問題でした。非常に@Henrik –

関連する問題