3.04 Passing Data Through Props
App.js
import React, { Component } from 'react';
import './App.css';
import UserOutput from './UserOutput/UserOutput'
class App extends Component {
render() {
return (
<div className="App">
<UserOutput name="Pasha" age="47">
Git!
</UserOutput>
<UserOutput name="Masha" age="37">
Queen!
</UserOutput>
<UserOutput name="Chelsea" age="1">
Meow!
</UserOutput>
</div>
);
}
}
export default App;
UserInput.js
import React from 'react'
const userInput = () => {
return <input type="text"></input>
}
export default userInput
UserOutput.js
import React from 'react'
const userOutput = (props) => {
return (
<div>
<p>
I'm {props.name} and I am {props.age} years old!
</p>
<p>{props.children}</p>
</div>
)
}
export default userOutput