When the message is added, you need your data and the target domain node (we will call these variables data and el )
React.render(<MyComponent data={data} />, el);
Or without JSX
React.render(React.createElement(MyComponent, {data: data}), el);
Clear:
React.unmountComponentAtNode(el);
For server side rendering, you can:
React.renderToString(React.createElement(MyComponent, {data: data}))
and as long as the result ends with el on the client, you can set it using React.render, as described above.
FakeRainBrigand Nov 24 '14 at 20:43 2014-11-24 20:43
source share