This.props v this.props.value

Can someone help explain when to use this.props.value vs this.value with React components?

I have seen both used in the React projects and get confused as to why it’s not always this.props.value

Depends entirely on what this is…

If this is your component, then this.props.value is a prop from the component’s props object.

If this is some other object, then it’s a value from that object.

1 Like