Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You (and others) say that React can be introduced gradually, but then you say that it owns the DOM and is incompatible with JQuery unless you're careful. How are these reconciled? Can React manage only a subtree of the DOM and let JQ (et al) handle the rest?


Yes; you mount your top-level React component into a <div>, and React won't touch the DOM outside of that.

It also provides hooks that get called throughout the lifecycle of each component, including whenever it's been added to or about to be removed from the DOM. These can be used to integrate non-React Javascript behaviors that want direct access to the DOM, but you still have to properly handle cleaning up when React wants to take your DOM node away.


Hah, it's UpdatePanel all over again!


Except UpdatePanels are horrid whereas React is quite nice :P





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: