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:
parent
240730f3ed
commit
df67fa10f0
1 changed files with 1 additions and 0 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue