Skip to content

[@tanstack/svelte-form] Form Subscribe properties "canSubmit", "isSubmitted" are not reactive #1513

Open
@SiNONiMiTY

Description

@SiNONiMiTY

Describe the bug

The example provided on the documentation

https://tanstack.com/form/latest/docs/framework/svelte/guides/validation#preventing-invalid-forms-from-being-submitted

The props provided by the children() snippet are not reactive. I was trying to debug the example and see if the canSubmit & isSubmitting flags are changing

  {#snippet children(state)}
    <button type="submit" disabled={!state.canSubmit}>
      {state.isSubmitting ? '...' : 'Submit'} // Text never changes after submission
    </button>
  {/snippet}

The text on the button never changes, but a separate (@debug state.isSubmitting} indeed shows the value is changing but is not re-rendered.

Using a separately declared variable to track the submission with $state() on top level works as expected.

Your minimal, reproducible example

N/A

Steps to reproduce

Follow the example on the documentation

Expected behavior

The state variables must be reactive so it can be re-rendered

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

Mozilla Firefox 139.0b8

TanStack Form adapter

None

TanStack Form version

@tanstack/svelte-form: 1.11.1

TypeScript version

5.8.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions