显示错误:React.Children.only仅预期接收单个React元素的孩子

时间:2019-05-04 19:50:08

标签: react-redux

“显示错误:ReactDOM.render(,document.getElementById('root')); React.Children.only仅预期接收单个React元素的子元素。

    import React from 'react';
    import ReactDOM from 'react-dom';
    import './index.css';
    import App from './App';
    import * as serviceWorker from './serviceWorker';
    import {createStore,applyMiddleware,compose} from 'redux';
    import rootReducer from './store/reducers/rootReducer';
    import { Provider } from 'react-redux';
    import thunk from 'redux-thunk';
    import {reduxFirestore,getFirestore} from 'redux-firestore';
    import {reactReduxFirebase,getFirebase } from 'react-redux-firebase';
    import fbConfig from './config/fbConfig';

    const store=createStore(rootReducer,
        compose(
            applyMiddleware(thunk.withExtraArgument({ getFirestore,getFirebase})),
            reduxFirestore(fbConfig),
            reactReduxFirebase(fbConfig)
            )
        );
    // at this line showing me error
    ReactDOM.render(<Provider store={store} > <App /> </Provider>, document.getElementById('root'));

    serviceWorker.unregister();

0 个答案:

没有答案