From 010552a4fc10cf0376468679454db649da4b6d5e Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 12 Sep 2021 02:22:50 -0700 Subject: [PATCH] Move over App to .tsx --- index.js | 2 +- package.json | 2 +- src/{App.jsx => App.tsx} | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) rename src/{App.jsx => App.tsx} (97%) diff --git a/index.js b/index.js index 599b3d9..574cbd0 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ import React from "react"; import ReactDOM from "react-dom"; -import App from "./src/App.jsx"; +import App from "./src/App.tsx"; const root = document.getElementById("root"); ReactDOM.render(, root); diff --git a/package.json b/package.json index 9dad55f..cada33e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "start": "parcel index.html", "build": "parcel build index.html --no-source-maps", "prebuild": "yarn run typecheck", - "typecheck": "tsc --noEmit", + "typecheck": "tsc --noEmit --jsx preserve", "lint": "eslint src/*", "lint-fix": "eslint src/* --fix" }, diff --git a/src/App.jsx b/src/App.tsx similarity index 97% rename from src/App.jsx rename to src/App.tsx index 576f2b5..39efa03 100644 --- a/src/App.jsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import React, {Component} from 'react'; import './App.scss'; -import {declineSaimiar} from './saimiar_morphology.ts'; +import {declineSaimiar} from './saimiar_morphology'; const backendUrl = 'https://kucinakobackend.ichigo.everydayimshuflin.com'; @@ -14,7 +14,7 @@ function makeRequest(queryString, jsonHandler) { }); } -function renderConlangName(name) { +function renderConlangName(name: string): string { if (name === 'saimiar') { return 'Saimiar'; } @@ -100,6 +100,10 @@ const Results = (props) => { ); }; +interface App { + [x: string]: any; +}; + class App extends Component { constructor(props) { super(props);