logoalt Hacker News

robertoandredyesterday at 5:24 PM1 replyview on HN

You seem to have a fundamental misunderstanding of React, Next, etc. They don't stop you from using native CSS or HTML functionality.


Replies

recursiveyesterday at 6:32 PM

Not technically, but they sure don't have to make it easy. Getting an element reference is clearly not the optimized-for use case. The docs even warn against it.

> Refs are an escape hatch. Manually manipulating another component’s DOM nodes can make your code fragile.

https://react.dev/learn/manipulating-the-dom-with-refs

show 1 reply