Comments (7)
If you provide me your code via StackBlitz I can try to investigate it. Here is a template: https://stackblitz.com/edit/modular-forms-react?file=src/routes/login.tsx
from modular-forms.
Make sense. Thank you!
from modular-forms.
You wrote "items.0.data.max_number" instead of "items.0.data.max_select", does this cause the problem? Also, when using arrays, I recommend using our specialized array functions. In your case you should probably use replace
. Read more here: https://modularforms.dev/qwik/guides/field-arrays#use-array-methods
from modular-forms.
You wrote "items.0.data.max_number" instead of "items.0.data.max_select", does this cause the problem?
Sorry, I just made a mistake when I simplified my code for reproduction (fixed). So it was not in my actual code.
Also, when using arrays, I recommend using our specialized array functions. In your case you should probably use
replace
.
Thank you for your advice! But unfortunately I got almost same error. For me, it seems that, with a object { x: string, y: number } | { x: string, z: boolean }
, inferred type of x
is correct but types of y, z
become never
.
from modular-forms.
Sure! Here is a reproduction from template: https://stackblitz.com/edit/modular-forms-react-7twxqr?file=src%2Froutes%2Freproduction.tsx
from modular-forms.
Thank you! I plan to have a look on it on the weekend.
from modular-forms.
It seems that this is the normal behavior of TypeScript when working with unions. The y
doesn't exist in every case, which is why TypeScript displays an error. A workaround might be to use setValues
: https://modularforms.dev/react/api/setValues
setValues(u, { x: 'ok', y: 'also ok' });
setValues(v, { data: { x: 'ok', y: 'also ok' } });
from modular-forms.
Related Issues (20)
- [Feature] Ability to configure different validations to run at different times HOT 1
- [Bug]: FormError is invoked only once on Qwik v1.4.5 HOT 5
- valiForm doesn't execute custom validation properly HOT 4
- hello facing types errors HOT 1
- Form submitted when filed has error HOT 2
- [Question] How to implement a controlled component contains multiple fields? HOT 3
- formAction$ code is not executed if Form component has "class" attribute HOT 8
- [Question] Render props pattern HOT 2
- Form action triggers drizzle polyfill issues. HOT 2
- Make the second parameter of the `formAction$` optional HOT 6
- loginForm.submitting not reactive
- Prevent Double Submit HOT 8
- Form action response is optional before form submit HOT 2
- Can I use modular-forms with action from "@solidjs/router"? HOT 11
- [React] Feature Request: Decouple Form and FormStore creation from components. HOT 2
- Form validation doesn't work when used with `valiForm` HOT 1
- Form shows as dirty when text input is focused but not changed.
- Zod Validation doesn't work with auto form. HOT 2
- [Solid] Is there a way to use field array with external store? HOT 1
- FieldValue does not accept bigint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modular-forms.