Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0e76452

Browse files
arrow function toggle with normal function when map the data from the data.js file
1 parent 1060034 commit 0e76452

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

‎travel-journal/src/App.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,30 @@ import world from "./images/world.png"
88
import pointer from "./images/placeholder.png"
99

1010
function App() {
11-
const dataset = Data.map((itemDetails) => {
12-
return (
13-
<Place
14-
point={pointer}
15-
details={itemDetails}
16-
/>
17-
)
11+
// const dataset = Data.map((Data) => { //This is Arrow function
12+
// return (
13+
// <Place
14+
// point={pointer}
15+
// details={Data}
16+
// />
17+
// );
1818

19-
})
19+
// })
20+
const dataset = Data.map(myDataFunction)
21+
function myDataFunction(elementItems) {
22+
return(
23+
<Place
24+
point = {pointer}
25+
details = {elementItems}
26+
/>
27+
);
28+
}
2029
return (
2130
<div className='react--app--container'>
2231
<div className="nav--cont--bar">
23-
2432
<Navbar img={world} />
2533
</div>
2634
<div className="app--container">
27-
28-
2935
{dataset}
3036
</div>
3137
</div>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /