Substitue {width}{height} in thumbnail_url dynamically

Hey guys, I know this has been posted before but I’m a new developer still learning the ropes and am trying to figure out how to add the desired width and height for my application in my request.

I found this “explanation” but don’t understand how to actually provide the desired width and height to make my code work.

This is how I’m pulling the URL:
img className=“card-img-top” src={channel.thumbnail_url} alt=“Cover”;

How do I insert the desired width and height?

Never mind, I figured it out. In case any other dev noobies run into this problem you have to use the .replace() method on the url.

Pretty much.

Just use whatever string find and replace functions your programming language of choice provides.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.