Unverified Commit df67fa10 authored by Rodrigo's avatar Rodrigo Committed by GitHub

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