compile a typescript react component with webpack

This commit is contained in:
Ian Minoso 2016-10-18 17:16:01 -04:00
parent 9015b09026
commit 5a45f140c2
5 changed files with 22 additions and 32 deletions

View file

@ -0,0 +1,10 @@
import * as React from "react";
class repoHeader extends React.Component<{}, {}> {
render () {
return <p> The component for the header</p>;
}
}
export default repoHeader;

View file

@ -1,20 +0,0 @@
/**
* A react component implemented using the ngReact library
*/
var testComponent = React.createClass({
propTypes: {
firstProp: React.PropTypes.string.isRequired,
secondProp: React.PropTypes.string.isRequired
},
render: function() {
return React.DOM.span(null,
'This is a react component: ' + this.props.firstProp + ' ' + this.props.secondProp
);
}
});
angular.module('quayPages').value('test-component', testComponent);
angular.module('quayPages').directive('testComponent', function(reactDirective) {
return reactDirective('testComponent');
});