#Has anyone created a Dynamic form with Remix or React-Router v6.4 ?

1 messages · Page 1 of 1 (latest)

woven sail
#

Hi everyone,

So currently I'm creating a client rendering app with react-router and eventually I'm going to be porting it over to Remix/React-Router v6.4. However, there is one part of the app I'm not comfortable that is the dynamic form part.

Usually I would use something like Formik for form management so I can easily update form data, however, Remix uses the <Form/> which uses native web features like the formData so you can't access values as they are updated (Correct me If I'm wrong 😄).

What I want to be able to do is something like this:

  • You uncheck a checkbox e.g. Filter by all countries
  • Show's an additional field like a countires dropdown

OR

  • Check a checkbox
  • Programatically certain values

Is there a way to be able to able to achieve the abvoe functionality the Remix way or would I need to introduce something like Formik and just face it there is no other way 🤣

Any comments are greatly appreciated about this post. 😄

Thank's,

Alex

woven sail
#

Has anyone created a Dynamic form with Remix and React-Router v6.4 yet ?

#

Has anyone created a Dynamic form with Remix or React-Router v6.4 ?

keen tangle
#

Just manage your form however you want and submit the corresponding data with use submit

winged kelp
#

Yeah, the Form component is mainly around submitting data, you can use normal React state to do conditional rendering to render specific fields if a checkbox is checked/do whatever

#

You can access the data, by having event handlers on the form/form fields

woven sail
#

Ah ok fair enough, look's like I'll have to use on my Form functionality ie Formik and use the useSubmit hook then. Shame really, didn't want to add extra dependendencies but I guess it's fine as it's a dynamic form and not the usual box standard form.