T
TanStack8mo ago
mute-gold

Custom Meta value for field?

We want to show our users when a field has been prefilled (and change some styling when they edit it). I'd love to have the ability to add a custom meta field like field.meta.isPrefilled (boolean) to keep track of this. The AI Orama chatbot seems to think it's possible, which leads me to believe it was possible with older versions. const { field } = useField('yourFieldName'); // To set custom meta values field.updateMeta({ customKey: 'customValue' }); // To access the custom meta values const customMeta = field.meta.customKey; But this isn't real in the current version of tanstack form. Anyone know if it's possible to add custom meta properties to fields?
2 Replies
fair-rose
fair-rose8mo ago
Not possible today, but the feature is in the works
fair-rose
fair-rose8mo ago
GitHub
Meta api for form fields · Issue #1111 · TanStack/form
Continuation from the discussion #709. Listeners are implemented, however the meta field is yet to be started. The proposal is to have the meta data available to the field component: (example shame...

Did you find this page helpful?