Can someone help me understand how to access values from the template reducer using 'connect'?
I encountered the following error message:
Uncaught ReferenceError: ReservationCard is not defined
You can view the complete code in this jsfiddle link.
Below is a snippet from the code:
export default React.createClass({
propTypes: {
value: React.PropTypes.object.isRequired,
profile: React.PropTypes.object.isRequired,
SPORTSDetails: React.PropTypes.shape({
error: React.PropTypes.object,
SPORTSId: React.PropTypes.number,
SPORTSName: React.PropTypes.string,
SPORTSAmount: React.PropTypes.number,
SPORTSDate: React.PropTypes.string,
isRetrieving: React.PropTypes.boolean
}),
onEdit: React.PropTypes.func.isRequired
},
displayName: 'ReservationCard',
})
export default connect(state => ({
profile: state.template.profile,
}), null, null, {
withRef: true // allows parent to access component functions
})(ReservationCard);