score:17

Accepted answer

yes, if you don't modify a subtree within react then the dom won't be touched at all. it's easy to wrap non-react functionality like a handlebars template in react. you can either use dangerouslysetinnerhtml:

render: function() 
    return <div dangerouslysetinnerhtml={{__html: template(values)}}>;
}

or you can simply return an empty div and populate (or attach event handlers, etc) it in componentdidmount:

render: function() 
    return <div />;
},
componentdidmount: function() {
    var node = react.finddomnode(this);
    node.innerhtml = template(values);
}

in the latter case, react won't touch the dom after the initial render because render always returns the same thing.

score:0

have a look at this module. simple and very effective. https://gist.github.com/alexeisavca/d4ff175fd16c93c8785d

here's a coffeescript version of it.

module.exports = reactignore = react.createclass
  shouldcomponentupdate: ->
    false
  render: ->
    react.children.only @props.children

and wrap your component in it:

<reactignore>
  yourcomponent
</reactignore>

Related Query

More Query from same tag