简体   繁体   中英

Cannot resolve module 'react-redux/lib/components/connect'

I am updating my project to the latest version of react, react-redux, react-dom, etc , and I encountered the following error:

ERROR in ./app/components/Modules/AdsBanner/index.js
Module not found: Error: Cannot resolve module 'react-redux/lib/components/connect' in /home/cpt/Desktop/prod/local/app/components/Modules/AdsBanner
 @ ./app/components/Modules/AdsBanner/index.js 51:15-60

Here is the part of the code where the conflict comes from:

import connect from 'react-redux/lib/components/connect';
//some code
export default connect(({regular}) => ({regular}))(AdBanner);

Can you please tell whether it is worth rolling back to the previous version of react-redux , or rewrite this part of the code? Unfortunately, I did not find similar information anywhere. Thanks so much for any advice :)

connect is from react-redux right so we have to import like import { connect } from 'react-redux'; once try it may useful to you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM