Hi!
I am working on an app using qwik v2 now, and I can't get this library to work.
I was using modular forms at first, which seems to work with beta.11, but doesn't work with beta.13.
So I decided to try this one out and it doesn't seem to work with either beta.13 or beta.11.
How to reproduce
Create a new qwik v2 app
Complete installation steps as described in the docs
pnpm add valibot
pnpm add @formisch/qwik
Create a new route and paste the example code to index.tsx from the docs
import { Field, Form, useForm$ } from '@formisch/qwik';
import { component$ } from '@qwik.dev/core';
import * as v from 'valibot';
const LoginSchema = v.object({
email: v.pipe(v.string(), v.email()),
password: v.pipe(v.string(), v.minLength(8)),
});
export default component$(() => {
const loginForm = useForm$({
schema: LoginSchema,
});
return (
<Form of={loginForm} onSubmit$={(output) => console.log(output)}>
<Field
of={loginForm}
path={['email']}
render$={(field) => (
<div>
<input {...field.props} value={field.input.value} type="email" />
{field.errors.value && <div>{field.errors.value[0]}</div>}
</div>
)}
/>
<Field
of={loginForm}
path={['password']}
render$={(field) => (
<div>
<input {...field.props} value={field.input.value} type="password" />
{field.errors.value && <div>{field.errors.value[0]}</div>}
</div>
)}
/>
<button type="submit">Login</button>
</Form>
);
});
Run the app with pnpm run dev and navigate to the route.
Details
The error message is a bit cryptic, but as far as I can tell it originates from the very beginning of the useForm$ hook .
I'm no expert at qwik internals, but speculating, I think Qwik somehow not realising that useForm hook runs inside a component, so it errors out.
Please let me know if you need any more info/help :)
Hi!
I am working on an app using qwik v2 now, and I can't get this library to work.
I was using modular forms at first, which seems to work with beta.11, but doesn't work with beta.13.
So I decided to try this one out and it doesn't seem to work with either beta.13 or beta.11.
How to reproduce
Create a new qwik v2 app
Complete installation steps as described in the docs
Create a new route and paste the example code to index.tsx from the docs
Run the app with
pnpm run devand navigate to the route.Details
The error message is a bit cryptic, but as far as I can tell it originates from the very beginning of the useForm$ hook .
I'm no expert at qwik internals, but speculating, I think Qwik somehow not realising that useForm hook runs inside a component, so it errors out.
Please let me know if you need any more info/help :)