fix(youtube-embed): each child in a list should have a unique "key" prop (#57579)

Hi,

I added a key in the map iteration of scripts in Youtube Embed. I use the index as a key but maybe there are a better solution about this like script.url + index 🤔 

There isn't open related issues with this PR as this moment.

```js
      {scripts?.map((script, index) => (
        <Script
          key={index}
          src={script.url}
          strategy={scriptStrategy[script.strategy] as ScriptProps['strategy']}
          stylesheets={stylesheets}
        />
      ))}
```
This commit is contained in:
Rodrigo 2023-10-31 13:16:57 +01:00 committed by GitHub
parent 240730f3ed
commit df67fa10f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,6 +25,7 @@ export default function YouTubeEmbed(props: YouTubeEmbedTypes) {
>
{scripts?.map((script) => (
<Script
key={script.url}
src={script.url}
strategy={scriptStrategy[script.strategy] as ScriptProps['strategy']}
stylesheets={stylesheets}