

→ src/App.js
import React, { Component } from "react";
import "./App.css";
import Customer from "./components/Customer";
const customer = {
name: "홍길동",
birthday: "980101",
gender: "male",
job: "programmer",
};
function App() {
return (
<Customer
name={customer.name}
birthday={customer.birthday}
gender={customer.gender}
job={customer.job}
/>
);
}
export default App;
→ src/components/Customer.js
import React from "react";
function Customer() {
return (
<div>
<h2>{this.props.name}</h2>
<p>{this.props.birthday}</p>
<p>{this.props.gender}</p>
<p>{this.props.job}</p>
</div>
);
}
export default Customer;
→ src/components/Customer.js
import React from "react";
function Customer() {
return (
<div>
<h2>{props.name}</h2>
<p>{props.birthday}</p>
<p>{props.gender}</p>
<p>{props.job}</p>
</div>
);
}
export default Customer;

→ scr/components/Customer.js
import React from "react";
function Customer() {
return (
<div>
<h2>{props.name}</h2>
<p>{props.birthday}</p>
<p>{props.gender}</p>
<p>{props.job}</p>
</div>
);
}
export default Customer;
→ scr/components/Customer.js
import React from "react";
function Customer(props) {
return (
<div>
<h2>{props.name}</h2>
<p>{props.birthday}</p>
<p>{props.gender}</p>
<p>{props.job}</p>
</div>
);
}
export default Customer;
import React from "react";
function Customer(props) {
return (
<div>
<h2>{props.name}</h2>
<p>{props.birthday}</p>
<p>{props.gender}</p>
<p>{props.job}</p>
</div>
);
}
export default Customer;
import React, { Component } from "react";
import "./App.css";
import Customer from "./components/Customer";
const customer = {
name: "홍길동",
birthday: "980101",
gender: "male",
job: "programmer",
};
function App() {
return (
<Customer
name={customer.name}
birthday={customer.birthday}
gender={customer.gender}
job={customer.job}
/>
);
}
export default App;
