You certainly don't need react to embed a youtube video in a background.. this library provides a react component that does this, which is useful to react users who want this effect.
This is a serious dependency sandwich. If you want to put a single Youtube video in the background of a div then you don't need thousands of lines of code for managing player controls and state changes. You could probably take 1/10th of that code in youtube-react (the bit that integrates a react component with a 3rd party lib that wants control over the DOM, common pattern with React) and get the same result.
To do a simple k-means clustering on a textual corpus, someone might pull in all of scipy and ntlk which is tens of thousands of lines of code.
I think programmers don’t generally consider dependency size unless it’s on the order of multiple gigabytes.