Skip to content

Commit bd08c58

Browse files
fix(solid-form): use { equals: false } (#1246)
* use { equals: false } * ci: apply automated fixes and generate docs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 059b6d6 commit bd08c58

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

docs/framework/solid/reference/functions/createfield.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: createField
1111
function createField<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TParentSubmitMeta>(opts): () => FieldApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TParentSubmitMeta> & SolidFieldApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TParentSubmitMeta>
1212
```
1313

14-
Defined in: [packages/solid-form/src/createField.tsx:237](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L237)
14+
Defined in: [packages/solid-form/src/createField.tsx:236](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L236)
1515

1616
## Type Parameters
1717

docs/framework/solid/reference/functions/field.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: Field
1111
function Field<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnServer, TParentSubmitMeta>(props): Element
1212
```
1313

14-
Defined in: [packages/solid-form/src/createField.tsx:481](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L481)
14+
Defined in: [packages/solid-form/src/createField.tsx:480](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L480)
1515

1616
## Type Parameters
1717

docs/framework/solid/reference/type-aliases/fieldcomponent.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type FieldComponent<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync
1414
}) => JSXElement;
1515
```
1616

17-
Defined in: [packages/solid-form/src/createField.tsx:426](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L426)
17+
Defined in: [packages/solid-form/src/createField.tsx:425](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L425)
1818

1919
## Type Parameters
2020

packages/solid-form/src/createField.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,10 @@ function makeFieldReactive<
227227
TFormOnServer,
228228
TParentSubmitMeta
229229
> {
230-
const [flag, setFlag] = createSignal(false)
231-
const fieldApiMemo = createMemo(() => [flag(), fieldApi] as const)
232-
const unsubscribeStore = fieldApi.store.subscribe(() => setFlag((f) => !f))
230+
const [field, setField] = createSignal(fieldApi, { equals: false })
231+
const unsubscribeStore = fieldApi.store.subscribe(() => setField(fieldApi))
233232
onCleanup(unsubscribeStore)
234-
return () => fieldApiMemo()[1]
233+
return field
235234
}
236235

237236
export function createField<

0 commit comments

Comments
 (0)