-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a46c4a
commit 2cf2f38
Showing
10 changed files
with
11,525 additions
and
2,910 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
{ | ||
"name": "@etclabscore/pristine-typescript", | ||
"version": "1.0.0", | ||
"name": "@etclabscore/pristine-typescript-react", | ||
"version": "0.0.0-development", | ||
"description": "", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"lint": "tslint --fix -p .", | ||
"test": "npm run lint && jest --coverage" | ||
"test": "npm run lint && react-scripts test --coverage" | ||
}, | ||
"author": "", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@types/jest": "^24.0.13", | ||
"jest": "^24.8.0", | ||
"@types/react-dom": "^16.8.4", | ||
"jest": "24.7.1", | ||
"react-scripts": "^3.0.1", | ||
"ts-jest": "^24.0.2", | ||
"tslint": "^5.17.0", | ||
"typescript": "^3.5.1" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"dependencies": { | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<html> | ||
|
||
<body> | ||
<div id="root"></div> | ||
</body> | ||
|
||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { useState } from "react"; | ||
|
||
interface IProps { | ||
greeting: string; | ||
} | ||
|
||
function useCounter(defaultValue: number) { | ||
const [counter, setCounter] = useState(defaultValue); | ||
|
||
const incrementCounter = () => { | ||
setCounter(counter + 1); | ||
}; | ||
|
||
return [counter, incrementCounter]; | ||
} | ||
|
||
const MyApp = (props: IProps) => { | ||
const [counter, incrementCounter] = useCounter(0); | ||
return ( | ||
<div> | ||
<div> | ||
{props.greeting} | ||
<button onClick={incrementCounter as any}>Counter = {counter}</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MyApp; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import ReactDOM from "react-dom"; | ||
import React from "react"; | ||
import MyApp from "./containers/MyApp"; | ||
|
||
ReactDOM.render(<MyApp greeting="foo" />, document.getElementById("root")); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="react-scripts" /> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"module": "commonjs", | ||
"module": "esnext", | ||
"lib": [ | ||
"es2015", | ||
"dom" | ||
], | ||
"declaration": true, | ||
"outDir": "./build", | ||
"strict": true, | ||
"esModuleInterop": true | ||
} | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"allowSyntheticDefaultImports": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "preserve", | ||
"allowJs": true | ||
}, | ||
"include": [ | ||
"src" | ||
] | ||
} |