Reputation: 10957
I am trying to display my state in my render()
I am referencing my state this.props.UserDetails.accessCode
<tbody>
<tr>
<td>What is your access code</td>
<td>
{this.props.UserDetails.accessCode}
</td>
</tr>
and using mapStatetoProps
const mapStateToProps = store => {
return {
UserDetails: store,
};
};
My values appear empty? Any ideas?
Upvotes: 1
Views: 57
Reputation: 4725
I can't be certain what the shape of your store looks like, but when you write:
return {
UserDetails: store,
};
are you sure you don't mean?
return {
UserDetails: store.UserDetails,
};
Upvotes: 4