Skip to content
Source
Sign inSign up
TanStack/form

Props passed to the components generated by `withForm` are not reactive #2054

Send to my agent
Closedmistyharsh(GitHub profile, opens in a new tab) opened this issue 0 comments

Describe the bug

Following up with a discussion #2051, The component returned by withForm does not keep properties passed to it reactive.

Steps to reproduce

Create a simple form component:

export const InstituteForm = withForm({
  defaultValues: {
    name: '',
  },
  props: {
    status: { type: 'idle' },
    isSubmitting: false,
  },
  render(props) {
    createEffect(() => {
      console.log('Props', props.status, props.isSubmitting);
    });

    return (<div>Form Component</div>);
  },
});

When this component is used, the status and isSubmitting are not reactive and the createEffect() never runs.

<InstituteForm
  form={form}
  status={status()}
  isSubmitting={isSubmitting()}
/>

Expected behavior

In the shared example, the status and isSubmitting should be reactive.

How often does this bug happen?

Every time

Platform

It is reproducible as of:

  • @tanstack/solid-form@1.28.3
  • typescript@5.9.3
  1. LeCarbonator(GitHub profile, opens in a new tab) added labelstype: bug

  2. LeCarbonator(GitHub profile, opens in a new tab) added labelsgood first issue

Sign in to join this conversation.