Skip to content

React 19 form and useActionState support #4517

@jugglingcats

Description

@jugglingcats

Feature Request

Problem description

I'm updating an existing app using react-hook-form to React 19 and looking at the new form handling features.

Here is the example in the React docs: https://react.dev/reference/react/useActionState#using-information-returned-by-a-form-action.

Because action is not supported on SUIR Form, the I'm using the following workaround:

    const [error, asyncSubmit, is_pending] = useActionState<void | Error>(submitLogin, null)

    return (
        <form action={asyncSubmit}>
            <Form as={Segment}>
                <Form.Input
                    label="Email"
                    name="email"
                />
        ...

Proposed solution

Perhaps it's as simple as allowing action on Form and passing down to the rendered form element, or perhaps this warrants looking at "in the round", I'm not sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions