Created
September 20, 2015 19:01
-
-
Save tomaskikutis/836c7ae9a7848275a3e5 to your computer and use it in GitHub Desktop.
react typescript browserify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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