list rendering

This commit is contained in:
Maciej Kotowski committed 2021-10-02 17:42:56 +02:00
1 parent bed77f0c03
commit 294ebcca92
2 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"start": "nodemon app.js", "start": "nodemon index.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "", "author": "",
+5 -3
View File
@@ -2,13 +2,15 @@ import { Stack } from "react-bootstrap";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
export const Home = () => { export const Home = () => {
const data =[{"name":"test1"},{"name":"test2"}];
return ( return (
<div className={styles.con}> <div className={styles.con}>
{" "} {" "}
<Stack gap={1}> <Stack gap={1}>
<div className={styles.item}>First item</div> {data.map(function(d, idx){
<div className={styles.item}>Second item</div> return (<div key={idx} className={styles.item}>{d.name}</div>)
<div className={styles.item}>Third item</div> })}
</Stack> </Stack>
</div> </div>
); );