Update TodoAppJs to match tutorial (#2190)

This commit is contained in:
Filip Sodić 2024-07-16 22:44:53 +02:00 committed by GitHub
parent 8099ef8b89
commit b5c15d1e3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 1333 additions and 1372 deletions

View File

@ -19,7 +19,7 @@ route RootRoute { path: "/", to: MainPage }
page MainPage {
authRequired: true,
// We specify that the React implementation of the page is exported from
// `src/MainPage.tsx`. This statement uses standard JS import syntax.
// `src/MainPage.jsx`. This statement uses standard JS import syntax.
// Use `@src` to reference files inside the `src` folder.
component: import { MainPage } from "@src/MainPage"
}

File diff suppressed because it is too large Load Diff

View File

@ -12,10 +12,12 @@ export const MainPage = () => {
return (
<div>
<NewTaskForm />
{tasks && <TasksList tasks={tasks} />}
{isLoading && 'Loading...'}
{error && 'Error: ' + error}
<button onClick={logout}>Logout</button>
</div>
)

View File

@ -5,6 +5,11 @@
// compiler. Proper TS compiler configuration in Wasp is coming soon :)
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
// We're bundling all code in the end so this is the most appropriate option,
// it's also important for autocomplete to work properly.
"moduleResolution": "bundler",
// JSX support
"jsx": "preserve",
"strict": true,
@ -20,7 +25,6 @@
// This is needed to properly support Vitest testing with jest-dom matchers.
// Types for jest-dom are not recognized automatically and Typescript complains
// about missing types e.g. when using `toBeInTheDocument` and other matchers.
// todo: check if jest still works
"node_modules/@testing-library",
// Specifying type roots overrides the default behavior of looking at the
// node_modules/@types folder so we had to list it explicitly.
@ -32,6 +36,6 @@
// compilation, the following directory doesn't exist. We need to specify
// it to prevent this error:
// https://stackoverflow.com/questions/42609768/typescript-error-cannot-write-file-because-it-would-overwrite-input-file
"outDir": ".wasp/phantom",
"outDir": ".wasp/phantom"
}
}