reactCompat

How to use the reactCompat transformer.

Output JSX into pre-v0.12 React syntax.

Usage

require("babel").transform("code", { optional: ["reactCompat"] });
$ babel --optional reactCompat script.js

Example

In

var profile = <div>
  <img src="avatar.png" class="profile" />
  <h3>{[user.firstName, user.lastName].join(' ')}</h3>
</div>;

Out

var profile = React.DOM.div(null,
  React.DOM.img({ src: "avatar.png", "class": "profile" }),
  React.DOM.h3(null, [user.firstName, user.lastName].join(" "))
);