If I have an object like below:
this.state = {
like: {
count: 100,
clicked: false
},
dislike: {
count: 25,
clicked: false
}
};
If have a variable name of var prop = 'like', how can I get the value of this.state.like using prop value?
I tried named property [this.state.prop] but it's not working.