Stateless components and stateful components

https://www.codecademy.com/paths/web-development/tracks/front-end-applications-with-react/modules/react-102-stateless-inherit-stateful-u/lessons/stateless-inherit-stateful-intro/exercises/stateful-parent-component

Hey guys I think I have a simple questions, and was hoping for some clarification on this exercise on ‘stateless components and stateful components’.

Please see the code below:

import React from ‘react’;
import ReactDOM from ‘react-dom’;
import { Child } from ‘./Child’;
class Parent extends React.Component {
constructor(props) {
** super(props);**
this.state = { name: ‘Frarthur’ };
}
render() {
return ;
}
};

Am I correct to assume the “constructor(props)” is taking information of other props from the ‘react’ file?, and that the “super(props)” is passing information such as the “this.state = { name: 'Frarthur }” back tot he react file making it access-able to the Child.js file?

Because in the Child.js… :

import React from ‘react’;
export class Child extends React.Component {
render() {
return

Hey, my name is {this.props.name}!


}
};

…I see a “{this.props.name}”. Is “props” here a place holder, or is it exchanging information with the Parent.js even though it’s not imported?

Just wanted clarification. Thank you in advance!

Hey -
You might want to go to the react documentation to see exactly how the lifecycles work under the hood.
I’m not sure if you are thinking about the ‘react’ file the right way - that is just the import of the react library.
You don’t even have to have a constructor with super(props) every time - I really only do that if that’s going to be a component that will have props passed into it. As the documentation says:

" When implementing the constructor for a React.Component subclass, you should call super(props) before any other statement. Otherwise, this.props will be undefined in the constructor, which can lead to bugs."

It’s not really “passing info back to the react file”, it’s just making sure you can refer to the component level info with the this keyword. the state object is also contained to the parent component. If you want the child to have access to that info, then pass if to the child as a prop.