Introduce React/TypeScript/TSLint into app for new UI components

npm run transpile
  Works on files under js/react/
  Outputs files right next to the .tsx file

This is part of our `grunt dev` task, as well as the default grunt task,
which does everything else necessary to get a raw git checkout ready to
run.
This commit is contained in:
Scott Nonnenberg 2018-03-26 11:44:45 -07:00
parent f86a6ef752
commit 893fb1cb9e
No known key found for this signature in database
GPG key ID: 5F82280C35134661
10 changed files with 739 additions and 27 deletions

38
js/react/sub/test2.tsx Normal file
View file

@ -0,0 +1,38 @@
import React from 'react';
interface IProps { name: string; }
interface IState { count: number; }
const items = [
'one',
'two',
'three',
'four',
];
export class InlineReply extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);
this.state = {
count: 0,
};
}
public render() {
const { name } = this.props;
return (
<div>
This is a basic component. Hi there, {name}!
</div>
);
}
}
export function greeter2(person: any) {
// console.log(items);
return `Hello, ${person}`;
}

7
js/react/test.ts Normal file
View file

@ -0,0 +1,7 @@
import { InlineReply } from './sub/test2';
// console.log(InlineReply);
export function greeter(person: any) {
return 'Hello, ' + person;
}