I have create a new react application using create-react-app cli. Then i have added the 'react-redux' library using npm install --save react-redux.
In package.json I have:
"react-redux": "^4.4.5"   Unfortunately, the app doesn't compile and it complains with:
Error in ./~/react-redux/lib/utils/wrapActionCreators.js Module not found: 'redux' in C:\Users\Salman\Desktop\Courses\Internship\React\Youtube-Front-End\node_modules\react-redux\lib\utils   @ ./~/react-redux/lib/utils/wrapActionCreators.js 6:13-29   I have no idea what does it mean?
Here is the complete container:
import React,{Component} from 'react'; import {connect} from 'react-redux';  class BookList extends Component{   renderList(){         return this.props.books.map((book)=>{           <li key={book.title} >{book.title}</li>         });     }    render(){      return(       <div>         <ul>           {this.renderList()}         </ul>       </div>     );   } }  function mapStateToProps(state){   return{     books:state.books   }; }  export default connect(mapStateToProps)(BookList);   Here is complete package.json:
{   "name": "Youtube-Front-End",   "version": "0.1.0",   "private": true,   "devDependencies": {     "react-scripts": "0.6.1",     "webpack": "^1.13.2"   },   "dependencies": {     "react": "^15.3.2",     "react-dom": "^15.3.2",     "react-redux": "^4.4.5",     "youtube-api-search": "0.0.5"   },   "scripts": {     "start": "react-scripts start",     "build": "react-scripts build",     "test": "react-scripts test --env=jsdom",     "eject": "react-scripts eject"   } } 
                React Redux 8.0 requires React 16.8. 3 or later (or React Native 0.59 or later). You'll also need to install Redux and set up a Redux store in your app. This assumes that you're using npm package manager with a module bundler like Webpack or Browserify to consume CommonJS modules.
You need to install react-redux but also redux library.
npm install --save redux 
                        react-redux internally uses Action, ActionCreator, AnyAction, Dispatch, Store these interfaces form redux package.
the moment you call
export default connect(mapStateToProps,mapDispatchToProps)(App);   react-redux try to make use of all these interfaces from redux package. which is not present at the moment.
So you may have to install react-redux package along with redux since both have dependency.
 npm install --save redux react-redux 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With