Skip to content

I'm new to React, how come I get [object Object] all the time? #21526

Discussion options

You must be logged in to vote

I’m on mobile so apologies for lack of formatting. You are incrementing the state object instead of increment the count property:

Your code: this.state + 1
Should be: this.state.count + 1

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants