कोड के नीचे देता हैआपको कनेक्ट करके लौटाए गए फ़ंक्शन में एक घटक पास करना होगा। इसके बजाय प्राप्त अपरिभाषित
Uncaught Error: You must pass a component to the function returned by connect. Instead received undefined
List.js
import React from 'react';
import { connect, bindActionCreators } from 'react-redux';
import PostList from '../components/PostList'; // Component I wish to wrap with actions and state
import postList from '../Actions/PostList' //Action Creator defined by me
const mapStateToProps = (state, ownProps) => {
return state.postsList
}
const mapDispatchToProps = (dispatch) => {
return bindActionCreators({"postsList":postList},dispatch)
}
export default connect(mapStateToProps, mapDispatchToProps)(PostList);
PostList.js
import React from 'react'
export const PostList = (props) => {
return <div>List</div>
}
कृपया मुझे एक समाधान के साथ मदद?
जांच Postlist आयात –
PostList आयात –
साथ कोई समस्या नहीं है क्या आप वाकई या तो निर्यात डिफ़ॉल्ट की जरूरत नहीं है कर रहे हैं या '..comcoments/PostList' से आयात {PostList}; – noveyak