react-redux : jsx, fragment

This commit is contained in:
haerong22
2021-03-08 01:54:46 +09:00
parent a3e60033dd
commit 2b51bcc65d

View File

@@ -1,29 +1,13 @@
import "./App.css";
const data = [
{
title: "Node",
value: 0,
},
{
title: "React",
value: 1,
},
];
const Head = (props) => <h1>{props.title}</h1>;
function App() {
return (
<div className="App">
<header className="App-header">
{data.map((item) => (
<>
<p key={item.value}>
{item.title}, {item.value}
</p>
</>
))}
</header>
</div>
<>
<Head title="this is a title" name="this is a name" />
<Head title="this is a title" name="this is a name" />
</>
);
}