Skip to content

Commit 9fda603

Browse files
authored
simple example stays simple (#6)
1 parent d3b25fa commit 9fda603

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/components/MyComponent/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import type { FunctionComponent } from "preact";
2-
import type { RoutableProps } from "preact-iso";
32
import { useEffect, useState } from "preact/hooks";
43
import { MyOtherComponent } from "../MyOtherComponent/index.tsx";
54

65
console.log("MyComponent is being synchronously imported...");
76

8-
type MyProps = RoutableProps & {
7+
type MyProps = {
98
foo: string;
109
};
1110

src/main.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ const GLOBAL_COMPONENTS_DIR: string = Deno.cwd() + "/src/components";
1717
@Controller()
1818
class MyController {
1919
@Get("/")
20-
simpleExample(ctx: Context) {
21-
return ssr(MyComponent, {
22-
path: ctx.request.url.pathname,
23-
foo: "bar",
24-
});
20+
simpleExample() {
21+
return ssr(MyComponent, { foo: "bar" });
2522
}
2623

2724
@Get("/app/:page*")

tests/MyComponent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { MyComponent } from "../src/components/MyComponent/index.tsx";
88
class FooController {
99
@Get("/")
1010
serve() {
11-
return ssr(MyComponent, { path: "/", foo: "bar" });
11+
return ssr(MyComponent, { foo: "bar" });
1212
}
1313
}
1414

0 commit comments

Comments
 (0)