Browse Source

Add information on JSX element keys (#6751)

main
Chad Fawcett 9 years ago
committed by Jim
parent
commit
614203a77d
  1. 4
      docs/02.3-jsx-gotchas.md

4
docs/02.3-jsx-gotchas.md

@ -40,10 +40,10 @@ A safer alternative is to find the [unicode number corresponding to the entity](
<div>{'First ' + String.fromCharCode(183) + ' Second'}</div>
```
You can use mixed arrays with strings and JSX elements.
You can use mixed arrays with strings and JSX elements. Each JSX element in the array needs a unique key.
```javascript
<div>{['First ', <span>&middot;</span>, ' Second']}</div>
<div>{['First ', <span key="middot">&middot;</span>, ' Second']}</div>
```
As a last resort, you always have the ability to [insert raw HTML](/react/tips/dangerously-set-inner-html.html).

Loading…
Cancel
Save