Migrate react app to typescript

Installed the necessary dependencies and config files
This commit is contained in:
RailTH
2024-02-02 15:46:28 +11:00
parent 85cce21e6b
commit c7c178857c
18 changed files with 73 additions and 17 deletions

View File

@@ -5,6 +5,7 @@ import ProfilePage from "./components/pages/ProfilePage";
import ScamPage from "./components/pages/ScamPage";
import Header from "./components/blocks/Header";
import SearchIcon from "../src/assets/icons/search-form__icon.svg";
import React from "react";
export default function App() {
return (

View File

@@ -1,4 +1,6 @@
export default function Header() {
import React from "react";
export default function Header(SearchIcon:any) {
return(
<header className="header">
<h1 className="header__title">SuSMarket</h1>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function LoginMenu() {
return(
<>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function PopupMap() {
return(
<>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function ProductCard() {
return(
<>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function HomePage() {
return(
<section>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function PaymentPage() {
return(
<>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function ProductPage() {
return(
<>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function ProfilePage() {
return(
<>

View File

@@ -1,3 +1,5 @@
import React from "react";
export default function ScamPage() {
return(
<>

4
reactapp/src/custom.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
declare module "*.svg" {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
export default content;
}

View File

@@ -4,7 +4,7 @@ import './index.scss';
import './reset.css';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
<React.StrictMode>
<App />