Skip to content

Commit

Permalink
Update 04-components.html (#14)
Browse files Browse the repository at this point in the history
Remove `key` from the `Fragment` example
  • Loading branch information
nem035 authored and kay-is committed Jun 28, 2018
1 parent 9295efa commit bd02f48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 04-components.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h2>{data}</h2>
}

// Since React 16.0.0, components can return an array of elements as well
// In doing so, no additional wrapper element is created.
// In doing so, no additional wrapper element is created
// One caveat is that, similarly to what we do when rendering an array,
// we have to add a unique key to each element in the array
// (we'll see more on this in the next lesson)
Expand All @@ -54,8 +54,8 @@ <h2 key="data">{data}</h2>
var data = "world"
return (
<Fragment>
<h1 key="hello">Hello</h1>
<h2 key="data">{data}</h2>
<h1>Hello</h1>
<h2>{data}</h2>
</Fragment>
)
}
Expand Down

0 comments on commit bd02f48

Please sign in to comment.