Q:

Confusion in props and state in REACT js

Just have a simple question here. I have 2 classes now, class AExample and BExample. So now, im creating an instance of class BExample in the render section of class AExample. I have added this code in class A in the render section. 
<BExample
state= {this.state}
/>

So in class BExample, when i try to 
console.log(props);

In the props value, Im getting the values of state. The problem is Im confused now, whether it is the state of BExample or AExample? Do you guys the state value represents which class? If yes why is it so?

A:

See, The state of AExample is now get set as a prop named state to the BExample component.
Any prop to a component as an attribute is referred as a prop to the attached component in react.
So, 
<BExample
state= {this.state}
/>

in the above example {this.state} is the state of the AExample but state is a prop of BExample. That is why when you log props it shows that state value of AExample.

