one change I needed: export const YoutubeEmbed = (embedId) =>
embedId && ( <iframe ... />);
jk that didn't fix my problem. for some reason it only works when I hard code the embedId
It's trying to fetch embed/[Object object]
For completenes sake, turns out it's a problem with my code that generates the embedId. I wish you could edit comments so I didn't have to triple post, but alas.
@prmichaelsen
That's because you have a typo, instead of:
export const YoutubeEmbed = (embedId) =>
try:
export const YoutubeEmbed = ({embedId}) =>
The [Object object] in your string is the first argument. You call it embedId here, but the first argument to a React FunctionComponent is the props object. For this case, it will look something like this:
{
embedId: "myidstring",
children: null
}
or similar.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
one change I needed:
export const YoutubeEmbed = (embedId) =>embedId && ( <iframe ... />);
jk that didn't fix my problem. for some reason it only works when I hard code the embedId
It's trying to fetch
embed/[Object object]For completenes sake, turns out it's a problem with my code that generates the
embedId. I wish you could edit comments so I didn't have to triple post, but alas.@prmichaelsen That's because you have a typo, instead of:
export const YoutubeEmbed = (embedId) =>try:
export const YoutubeEmbed = ({embedId}) =>The
[Object object]in your string is the first argument. You call itembedIdhere, but the first argument to a React FunctionComponent is the props object. For this case, it will look something like this:or similar.