Why does a basic react-native redux app throw "a could not find store error"
<p>I'm trying to get started with react native and I'm getting the following error on a basic app</p>

<pre><code>Could not find "store" in either the context or props of "Connect(App)". Either wrap the root component in a &lt;Provider&gt;, or explicitly pass "store" as a prop to "Connect(App)".
</code></pre>

<p>Here's my code </p>

<pre><code>import React, { Component, PropTypes } from 'react';
import { Text } from 'react-native';
import { createStore, combineReducers, applyMiddleware, compose } from 'redux';
import { Provider, connect } from 'react-redux';
import thunk from 'redux-thunk';

import reducer from './reducers/counter';

const store = createStore(
  combineReducers({
    counter: reducer,
  }),
  {}, // initial state
  compose(
      applyMiddleware(thunk),
  ),
);

class App extends Component {
  constructor(props) {
    super(props);
  }
  componentDidMount() {
  }

  render() {
    return (
      &lt;Provider store={store}&gt;
        &lt;Text&gt;Hello World&lt;/Text&gt;
      &lt;/Provider&gt;
    );
  }
}

App.propTypes = {
  dispatch: PropTypes.func.isRequired,
  counter: PropTypes.number,
};

function mapStateToProps(state) {
  return {
    counter: state,
  };
}

export default connect(mapStateToProps)(App);
</code></pre>

<p>And here's the reducer:</p>

<pre><code>// ./reducers/counter.js
export default (state = 0, action) =&gt; {
  switch (action.type) {
    case 'INCREMENT':
      return state + 1
    case 'DECREMENT':
      return state - 1
    default:
      return state
  }
}
</code></pre>