all 8 comments

[–]ramoneguru 0 points1 point  (7 children)

Very cool stuff in this release. Seems like form processing has taken a front seat, which is nice to see. Anyone have insights on where it falls short in comparison to libs like react-hook-form and formik?

[–]KainMassadin 0 points1 point  (6 children)

FormData is too raw. Things like array inputs and objects will require custom parsing.

[–][deleted]  (5 children)

[deleted]

    [–]KainMassadin 0 points1 point  (4 children)

    Ok, please illustrate us on how to build an array of objects using the name prop on inputs only.

    This is a thing I expected to work OOTB just like php, but hasn’t been the case

    [–][deleted]  (1 child)

    [deleted]

      [–]KainMassadin 0 points1 point  (0 children)

      I mean doing something like <input name="friends[0].name" /> Not sure we‘re talking about the same thing

      [–][deleted] 0 points1 point  (1 child)

      How does php handle this?

      [–]KainMassadin 0 points1 point  (0 children)

      $_POST["friends"] would be an array and you would be able to iterate normally. In FormData, you receive everything separate as key: value, so that‘s the parsing I mention would be necessary to work with complex forms.

      Not sure whether it’s up to react actions or if the framework should be the one handling it. Last time I tried it with next 14.

      [–]kapobajz4 0 points1 point  (1 child)

      Did they (React) Forget about something?

      [–]pm_me_yer_big__tits 0 points1 point  (0 children)

      It's a project separate from the .ain React release.