mirror of
https://github.com/facebook/react.git
synced 2026-02-25 05:03:03 +00:00
Add information on JSX element keys (#6751)
This commit is contained in:
@@ -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>·</span>, ' Second']}</div>
|
||||
<div>{['First ', <span key="middot">·</span>, ' Second']}</div>
|
||||
```
|
||||
|
||||
As a last resort, you always have the ability to [insert raw HTML](/react/tips/dangerously-set-inner-html.html).
|
||||
|
||||
Reference in New Issue
Block a user