Move over App to .tsx

This commit is contained in:
Greg Shuflin 2021-09-12 02:22:50 -07:00
parent 3b2083fa27
commit 010552a4fc
3 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import ReactDOM from "react-dom"; import ReactDOM from "react-dom";
import App from "./src/App.jsx"; import App from "./src/App.tsx";
const root = document.getElementById("root"); const root = document.getElementById("root");
ReactDOM.render(<App />, root); ReactDOM.render(<App />, root);

View File

@ -10,7 +10,7 @@
"start": "parcel index.html", "start": "parcel index.html",
"build": "parcel build index.html --no-source-maps", "build": "parcel build index.html --no-source-maps",
"prebuild": "yarn run typecheck", "prebuild": "yarn run typecheck",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit --jsx preserve",
"lint": "eslint src/*", "lint": "eslint src/*",
"lint-fix": "eslint src/* --fix" "lint-fix": "eslint src/* --fix"
}, },

View File

@ -1,7 +1,7 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import './App.scss'; import './App.scss';
import {declineSaimiar} from './saimiar_morphology.ts'; import {declineSaimiar} from './saimiar_morphology';
const backendUrl = 'https://kucinakobackend.ichigo.everydayimshuflin.com'; 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') { if (name === 'saimiar') {
return 'Saimiar'; return 'Saimiar';
} }
@ -100,6 +100,10 @@ const Results = (props) => {
); );
}; };
interface App {
[x: string]: any;
};
class App extends Component { class App extends Component {
constructor(props) { constructor(props) {
super(props); super(props);