title: how to get data from json file in react?
body: <p>I am using <code>redux-thunk</code> to get data from json file .I follow this url </p>
  
  <p><a href="https://github.com/gaearon/redux-thunk" rel="nofollow noreferrer">https://github.com/gaearon/redux-thunk</a>
  I am getting this error</p>
  
  <p><strong>middleware is not a function</strong></p>
  
  <p>could you please tell me how to get data from json file and show in component </p>
  
  <p>here is my code
  <a href="https://plnkr.co/edit/R6TCNcK4kUaRkTDpObQN?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/R6TCNcK4kUaRkTDpObQN?p=preview</a></p>
  
  <pre><code>const {thunk} =ReduxThunk;
  const abc= (state=0,action) =&gt; {
    console.log('in redux', action.type)
    switch(action.type){
      case 'INC':
  
        return state +1
      case 'DEC':
        return state -1
        default :
        return state;
    }
  }
  const {createStore,bindActionCreators ,applyMiddleware } =Redux;
  const {Provider,connect} =ReactRedux;
  
  const store = createStore(abc,
  applyMiddleware(thunk)
  );
  
  
  class First extends React.Component {
    constructor (props){
      super(props);
      this.state ={
      digit :0  
      }
    }
    inc (){
      console.log('ince', this.props)
      this.props.increment();
    }
  
    dec (){
      console.log('dec')
      this.props.decrement();
    }
    getDate(){
  
    }
    render(){
      return (
      &lt;div&gt;
          &lt;button onClick={this.inc.bind(this)}&gt;INCREMENT&lt;/button&gt;
          &lt;p&gt;{this.props.digit}&lt;/p&gt;
          &lt;button onClick={this.dec.bind(this)}&gt;DECREMENT&lt;/button&gt;
          &lt;button onClick={this.getDate.bind(this)}&gt;GET DATA&lt;/button&gt;
        &lt;/div&gt;
      )
    }
  } 
  
  const actions = {
      increment: () =&gt; {
          return {
              type: 'INC',
          }
      },
       decrement: () =&gt; {
          return {
              type: 'DEC',
          }
      }
  };
  
  const AppContainer = connect(
      function mapStateToProps(state) {
          return {
              digit: state
          };
      },
      function mapDispatchToProps(dispatch) {
          return bindActionCreators(actions, dispatch);
      }
  )(First);
  ReactDOM.render(
     &lt;Provider store={store}&gt;
      &lt;AppContainer/&gt;
    &lt;/Provider&gt;
    ,document.getElementById('root'))
  </code></pre>