Skip to content

Comment on Virtual DOM in Elmparent

Comments

This got me wondering how React handles this requirement. Can you use React if you need to know offsetWidth/Height to do complex layout?

Once the component is mounted (there's a componentDidMount callback) you have access to the real DOM node and can access them (or perhaps store them as a property if necessary). The DOM node is also available from event callbacks and such.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.