Question

I just wanted to get the HTML from a ReactJS component. I use a jquery module that need some HTML as parameter. I'm using coffeescript and ReactJS for the rest of the application.

Action = React.createClass
  render: -> [...]

  componentDidMount: ->
    $(myJQueryModule).action(
      html: $(@props.html).html()
    )

Action
  html: React.DOM.span {className: "test"}, "test of text"

Btw, this is not working and I have some troubles to understand why. Can someone help :) ?

Ty

No correct solution

OTHER TIPS

A component doesnt get rendered to text like that, You probably want to use http://facebook.github.io/react/docs/top-level-api.html#react.rendercomponenttostring

But is wont have any React integrations and events etc, so you might be better by just use normal HTML in a string to feed to the jquery.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top