Commit e506c41e authored by Christoph Tavan's avatar Christoph Tavan Committed by Tim Neutkens

Ensure that all <link> elements have a key prop (#9204)

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
```
parent 4421448f
...@@ -146,6 +146,7 @@ export class Head extends Component< ...@@ -146,6 +146,7 @@ export class Head extends Component<
cssFiles.forEach(file => { cssFiles.forEach(file => {
cssLinkElements.push( cssLinkElements.push(
<link <link
key="${file}-preload"
nonce={this.props.nonce} nonce={this.props.nonce}
rel="preload" rel="preload"
href={`${assetPrefix}/_next/${encodeURI(file)}`} href={`${assetPrefix}/_next/${encodeURI(file)}`}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment