react-redux : jsx, fragment
This commit is contained in:
26
react-redux/src/App.js
vendored
26
react-redux/src/App.js
vendored
@@ -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" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user