Yes, if you do not change the subtree inside React, then the DOM will not touch at all. It's easy to wrap non-React functionality like the Handlebars template in React. You can use dangerouslySetInnerHTML :
render: function() return <div dangerouslySetInnerHTML={{__html: template(values)}}>; }
or you can just return an empty div and fill it (or attach event handlers, etc.) to it in componentDidMount:
render: function() return <div />; }, componentDidMount: function() { var node = React.findDOMNode(this); node.innerHTML = template(values); }
In the latter case, React will not touch the DOM after the initial rendering, because render always returns the same.
Sophie Alpert Jan 22 '14 at 17:47 2014-01-22 17:47
source share