import React, {Component} from 'react';
class App extends Component {
render() {
return (
<div>
// passing attributes (i.e. props) to the person component
<Person name="Brad" age="22" />
// passing data between the opening and closing tags of a component i.e. children
<Person name="Eleanor" age="21">My hobbies include make-up and animals</Person>
</div>
);
}
}
export default App;
import React from 'react';
const person = (props) => {
return (
<p>Hi! Im {props.name} and Im {props.age} years old</p>
<p>{props.children}</p>
);
}
export default App;