import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import Login from './js/components/Login';
import userReducers from './js/reducers/user';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
let store = createStore(combineReducers({userReducers}));
class App extends Component {
render() {
return (
<Login />
);
}
}
export default class Testextends Component {
render() {
return (
<Provider store = {store}>
<App />
</Provider>
// <View>
// <Text>jhdgf</Text>
// </View>
);
}
}
AppRegistry.registerComponent('Test',() => Test);
它給了我以下錯誤:React.Children.only有望獲得一個陣營元素孩子
我想反應母語與終極版的一個基本的例子。如果我也刪除TouchableHighlight,錯誤仍然存在。任何想法這裏有什麼不對?
嘿,我現在面臨同樣的問題。你找到了這個根源嗎? – webdevbyjoss