JSX in Tonic

node v0.12.18
version: 1.0.0
Tonic supports JSX right out of the box. Make sure to include React and you're all set to go:
var React = require("react"); var myGreatReactElement = <div>Hello World!</div>; React.renderToString(myGreatReactElement);
You'll notice that we used renderToString instead of render. That's because Tonic is a node environment. Tonic is a great way to test server rendering for React. To learn more about React, check out https://facebook.github.io/react/docs/getting-started.html

1 comment

  • posted 23 days ago by 5dab241ba284c40013cbf083

sign in to comment