Skip to content

Conversation

@Rajesh-Royal
Copy link

Your code through runtime error that state.age is not defined.
To solve this when you mapStateToProps you could have passed some default value to the state.

here: -------

const mapStateToProps = (state = {age: 21}) => { 
return { age: state.age } 
};

Error stage Image:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant