export function Field(props: { form: Form; children: JSXElement }) { // `Form` is a SolidJS store
const fieldState = createMemo(() => {
return {
value: store.value,
isDisabled: store.isDisabled,
isRequired: store.isRequired,
hasError: store.hasError,
};
});
createEffect(() => console.log('Changed', fieldState()); // Is logging successfully on changes
return props.children(fieldState());
}
// ---------------------------
<Field form={myForm}>
{(fieldState) => (
<>
<p>{JSON.stringify(fieldState)}</p> // !! Not updating on changes
<CustomInput {...fieldState} />
</>
)}
</Field>
export function Field(props: { form: Form; children: JSXElement }) { // `Form` is a SolidJS store
const fieldState = createMemo(() => {
return {
value: store.value,
isDisabled: store.isDisabled,
isRequired: store.isRequired,
hasError: store.hasError,
};
});
createEffect(() => console.log('Changed', fieldState()); // Is logging successfully on changes
return props.children(fieldState());
}
// ---------------------------
<Field form={myForm}>
{(fieldState) => (
<>
<p>{JSON.stringify(fieldState)}</p> // !! Not updating on changes
<CustomInput {...fieldState} />
</>
)}
</Field>