diff --git a/example/src/index.tsx b/example/src/index.tsx
index c5450413..808c2df8 100644
--- a/example/src/index.tsx
+++ b/example/src/index.tsx
@@ -48,6 +48,16 @@ app.frame('/', ({ status }) => {
}
})
+app.frame('/no-intents', () => {
+ return {
+ image: (
+
+ foo
+
+ ),
+ }
+})
+
export default {
port: 3001,
fetch: app.fetch,
diff --git a/src/index.tsx b/src/index.tsx
index 207bb379..1a74b0c3 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -35,7 +35,7 @@ type FrameContext = {
type FrameReturnType = {
image: JSX.Element
- intents: JSX.Element
+ intents?: JSX.Element
}
export class Framework extends Hono {
@@ -44,7 +44,7 @@ export class Framework extends Hono {
handler: (c: FrameContext) => FrameReturnType | Promise,
) {
// Frame Route (implements GET & POST).
- this.use(async (c) => {
+ this.use(path, async (c) => {
const context = await getFrameContext(c)
const { intents } = await handler(context)
const serializedContext = encodeURIComponent(JSON.stringify(context))
@@ -65,14 +65,14 @@ export class Framework extends Hono {
)}/image?context=${serializedContext}`}
/>
- {parseIntents(intents)}
+ {intents ? parseIntents(intents) : null}