React error 'Failed propType: Invalid prop `children` supplied to `Provider`, expected a single ReactElement'

According to the doc, you can just use a normal React element instead of a function inside <Provider />.

As a result, simply change your code to

<Provider store={store}>
    <App />
</Provider>

I think this has changed since [email protected].


The original question had a typo. Your response is correct in the proper syntax.

However, the direct reason is that <App /> needs to be on a separate line.

If you put it on the same line as <Provider store={store}> React/Redux tries to do more with it than it should.

ReactDOM.render(
<Provider store={store}>
  <App />
</Provider>,
  document.getElementById('root')
);