4 ms·
I moved away from React when I noticed how difficult it was to use raw elements (without the "Component" stuff). Also, I never knew when updates were taking pla
by amelius 11y ago
I moved away from React when I noticed how difficult it was to use raw elements (without the "Component" stuff). Also, I never knew when updates were taking place in the real DOM.
- DiNovi 11y agohow could you not know?
- amelius 11y agoBecause componentDidMount only works for components, not elements.
- tracker1 11y agoBecause using raw elements is supposed to be the exception, not the rule... also `componentDidMount` and `componentDidUpdate` combined with refs is pretty straight forward[1]. I'm integrating PDF.js into a react app, and that has been anything but fun (still need to do more for performance concerns), but this is abnormal for react apps... More often than not, if you need to use refs a lot, and are doing a lot of DOM manipulation directly, odds are "you're doing it wrong" ... I'm not saying there are never times, but there are usually better and less cumbersome patterns. One of the things I really like about react+redux, it it's closer to 95/5 than 80/20, and when you find yourself fighting the flow, usually the answer is to rethink the problem. https://facebook.github.io/react/docs/component-specs.html https://facebook.github.io/react/docs/component-specs.html