4 ms·
This got me wondering how React handles this requirement. Can you use React if you need to know offsetWidth/Height to do complex layout?
by joesb 12y ago
This got me wondering how React handles this requirement. Can you use React if you need to know offsetWidth/Height to do complex layout?
- ksherlock 12y agoOnce 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.