Skip to content

Commit

Permalink
Ensure that all <link> elements have a key prop (#9204)
Browse files Browse the repository at this point in the history
Before this patch users would see the following warning during initial
compilation:

```
Warning: Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
    in link
    in Head
    in html
    in Html
    in Document
    in Context.Provider
    in Context.Provider
```
  • Loading branch information
ctavan authored and timneutkens committed Oct 26, 2019
1 parent 4421448 commit e506c41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class Head extends Component<
cssFiles.forEach(file => {
cssLinkElements.push(
<link
key="${file}-preload"
nonce={this.props.nonce}
rel="preload"
href={`${assetPrefix}/_next/${encodeURI(file)}`}
Expand Down

0 comments on commit e506c41

Please sign in to comment.