Alex
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
3 deletions
-
content/blog/2017-11-28-react-v16.2.0-fragment-support.md
|
|
@ -33,7 +33,7 @@ More text. |
|
|
|
Even more text. |
|
|
|
``` |
|
|
|
|
|
|
|
Prior to version 16, the only way to acheive this in React was by wrapping the children in an extra element, usually a `div` or `span`: |
|
|
|
Prior to version 16, the only way to achieve this in React was by wrapping the children in an extra element, usually a `div` or `span`: |
|
|
|
|
|
|
|
```js |
|
|
|
render() { |
|
|
@ -142,8 +142,8 @@ function Glossary(props) { |
|
|
|
{props.items.map(item => ( |
|
|
|
// Without the `key`, React will fire a key warning |
|
|
|
<Fragment key={item.id}> |
|
|
|
<dt>{item.term}</li> |
|
|
|
<dd>{item.description}</li> |
|
|
|
<dt>{item.term}</dt> |
|
|
|
<dd>{item.description}</dd> |
|
|
|
</Fragment> |
|
|
|
)} |
|
|
|
</dl> |
|
|
|