T
TanStack6mo ago
extended-salmon

Forms with a CMS

All the examples show building forms with static name fields to maintain strict typing. With a CMS like Payload I do not know the names ahead of time. The issue I have is I need to create wrappers around a withForm() component so I can pass the function that generates the def ault fields. This works fine besides having to pass the form as a prop typed as any. Has anyone figured out a clean way of creating reusable components and fields this way? Another wall was useFormContext() returns a form without AppField, so I need to pass the form via props here too. I think Crutchcorn mentioned we could create our own form context if we want, but I'm 100% positive I'll butcher that all to heck
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?