Skip to content

ctx.render() has changed #2969

@marvinhagemeister

Description

@marvinhagemeister

Reported on discord: https://discord.com/channels/684898665143206084/991511118524715139/1373686843916419273

I am unable to use the ctx.render function to send props, and have to rely on async function in Fresh2

// fresh 1 
export const handlers = = {
  async GET(req, ctx) {
    const data = await Query();
     ctx.render({ value: data })
  }
}

export const Component({ data }) {
  ...
}

I have to use async components instead

export async function Component({ data }) {
  const data = await Query();
  
  ...
}

can this be mentioned in the migration guide? Cause compatibility is not there

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions