@starrdev
I'm having issues passing state between different components.
https://github.com/airswap/frames/blob/fix-otcurl-input/templates/next-starter-with-examples/app/frames/frames.ts
First I declared my initial state in the frames.ts file:
`import { createFrames } from "frames.js/next";
export type State = {
otcUrl: string;
}
export const frames = createFrames<State>({
basePath: "/frames",
initialState: {
otcUrl: ""
},
debug: process.env.NODE_ENV === "development",
});`
https://github.com/airswap/frames/blob/fix-otcurl-input/templates/next-starter-with-examples/app/frames/route.tsx
Then I update state when input changes in route.tsx:
`const currentState = ctx.state;
const updatedState = {
...currentState,
otcUrl: ctx.message?.inputText || undefined
}`
https://github.com/airswap/frames/blob/fix-otcurl-input/templates/next-starter-with-examples/app/frames/url_list/route.tsx
Then I extract state from the context object, but it's not working.
`const otcUrl = ctx.state.otcUrl`