Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TanStack Start adapter #1023

Open
Balastrong opened this issue Nov 16, 2024 · 3 comments
Open

Update TanStack Start adapter #1023

Balastrong opened this issue Nov 16, 2024 · 3 comments

Comments

@Balastrong
Copy link
Member

The Start demo is currently broken, we should update @tanstack/react-form/start with the new createServerFn APIs

@Balastrong
Copy link
Member Author

Balastrong commented Nov 19, 2024

Also mentioning #1006 as it might be included here to investigate if we can remove @remix-run/node as a direct dependency

@austinm911
Copy link

Hi - would there an update here since Start is now in beta?

@discoverlance-com
Copy link

Any update on this? It seems not to be working.

In this example:



export const handleForm = createServerFn(
  'POST',
  async (formData: FormData, ctx) => {
    try {
      await serverValidate(ctx, formData)
    } catch (e) {
      if (e instanceof ServerValidateError) {
        return e.response
      }

      // Some other error occurred when parsing the form
      console.error(e)
      return new Response('There was an internal error', {
        status: 500,
      })
    }

    return new Response('Form has validated successfully', {
      status: 200,
    })
  },
)

It no longer works and I try to refactor but I don't know what to pass as the ctx, also should we use the validator to run the serverValidate function or we run it in our handler? And the response return no longer seems to work in the handler as the handler does not expect a response to be returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants