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:
parent
f86a6ef752
commit
893fb1cb9e
10 changed files with 739 additions and 27 deletions
38
js/react/sub/test2.tsx
Normal file
38
js/react/sub/test2.tsx
Normal 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
7
js/react/test.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { InlineReply } from './sub/test2';
|
||||
|
||||
// console.log(InlineReply);
|
||||
|
||||
export function greeter(person: any) {
|
||||
return 'Hello, ' + person;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue