React with responsiveness

In any application, you can grab the reference (useRef) of it and check its width, and then ask to remove it from the DOM. In React, there is a popular library for this, whose name I don't remember, and another one called react-media. I discovered react-media because it works with Server-Side Rendering (SSR). The problem with using the CSS @media was due to performance issues after the build.