Skip to content

Instantly share code, notes, and snippets.

@tomaskikutis
Created September 20, 2015 19:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tomaskikutis/836c7ae9a7848275a3e5 to your computer and use it in GitHub Desktop.
Save tomaskikutis/836c7ae9a7848275a3e5 to your computer and use it in GitHub Desktop.
react typescript browserify
// npm install browserify -g
// npm install tsd -g
// npm install react tsify
// tsd install react
// browserify app.tsx -p [tsify --jsx=react] -o bundle.js
/// <reference path="typings/react/react.d.ts" />
import React = require("react");
interface HelloWorldComponentProps extends React.Props<any> {
text: string;
}
class HelloWorldComponent extends React.Component<HelloWorldComponentProps, {}> {
render() {
return <div>Hello {this.props.text}!</div>;
}
}
React.render(<HelloWorldComponent text="Steve" />, document.getElementById("content"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment